DataFrame object has no attribute 'sort_values'

dataset = pd.read_csv("dataset.csv").fillna(" ")[:100] dataset['Id']=0 dataset['i']=0 dataset['j']=0 #... entries=dataset[dataset['Id']==0] print type(entries) # Prints <class 'pandas.core.frame.DataFrame'> entries=entries.sort_values(['i','j','ColumnA','ColumnB']) 

What might be the possible reason of the following error message at the last line?:

AttributeError: 'DataFrame' object has no attribute 'sort_values' 
0

2 Answers

Hello sort_values is new in version 0.17.0, so check your version of pandas. In the previous versions you should use sort.

entries=entries.sort(['i','j','ColumnA','ColumnB']) 
5

Check pandas version, In new versions uses sort_values in place of sort.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like