23
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'
Klausos Klausos
  • 15,308
  • 51
  • 135
  • 217

2 Answers2

27

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'])
Romain
  • 19,910
  • 6
  • 56
  • 65
3

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

ah bon
  • 9,293
  • 12
  • 65
  • 148
Gagan
  • 61
  • 3