19
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
  • 14,142
  • 48
  • 129
  • 212

2 Answers2

25

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
  • 16,760
  • 6
  • 49
  • 57
2

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

ah bon
  • 7,903
  • 7
  • 43
  • 86
Gagan
  • 51
  • 3