I have the below sample data:
class name
Pref Ab
Val BE
Base es
Pref Cw
Base SS
This data is in a dataframe and I need to create a mapping for class : name as shown below:
Pref : ['Ab','Cw'],
Val : ['BE'],
Base : ['es','SS']
This will be a dictionary which will contain a mapping for class and it's component names.The key will be class and it's values will be the names in that class, so a list of values for each class, where the list length might vary for each class. Can someone please help me with this?