I am trying to implement the code
sort_order = {
'Documentary':0,
'Film-Noir':1,
'Biography':2,
'History':3,
'War':4,
'News':5,
'Animation':6,
'Musical':7,
'Music':8,
'Drama':9
}
df.sort_values(by=['genre'], key=lambda x: x.map(sort_order))
But I receive this error:
TypeError: sort_values() got an unexpected keyword argument 'key'
I downloaded the latest version of Pandas to try and fix this using conda update pandas but this did not change anything. I know something is going wrong because their page here shows that key should be recognized.
Any help would be greatly appreciated.