in ()
1 P.columns = new_ind
----> 2 P = P.sort(axis=1) # Sort by columns
c:\python35\lib\site-packages\pandas\core\generic.py in __getattr__(self, name)
3079 if name in self._info_axis:
3080 return self[name]
-> 3081 return object.__getattribute__(self, name)
3082
3083 def __setattr__(self, name, value):
AttributeError: 'DataFrame' object has no attribute 'sort'
It seems sort is deprecated - now there is sort_values and sort_index.
Can you adapt code please?
I am getting error: P.columns = new_ind
P = P.sort(axis=1) # Sort by columns
AttributeError Traceback (most recent call last)