How to create new column and set values which are results of mapping this dataframe with another object for instance list of lists python?
I have pandas dataframe:
{'a': [15,10,11,9,7,8], 'b':['smth','smth','smth','smth', 'smth', 'smth'].
And list of list:
[[15,10], [11], [9,7,8]]
I want create new column in my dataframe, which will be contain 3 big classes like in my list of lists.
I mean, I want to get this:
{'a': [15,10,11,9,7,8], 'b':['smth','smth','smth','smth', 'smth', 'smth',
'new_column': [0,0,1,2,2,2]}
dataframe['new_column'] = ...from what you've shown so far