解决'DataFrame' object has no attribute 'sort'
程序员文章站
2022-07-13 10:56:06
...
代码
import tushare as ts
df = ts.profit_data(top=60)
df.sort('shares',ascending=False)
报错
AttributeError:'DataFrame' object has no attribute 'sort'
解决
df.sort_values('shares',ascending=False)
注:
有时需要把 column=‘shares’ 改成 ‘shares’
推荐阅读
-
module ‘seaborn‘ has no attribute ‘scatterplot‘解决方案
-
AttributeError: module ‘community‘ has no attribute ‘best_partition‘ 问题解决方法
-
解决DataFrame排序sort的问题
-
module ‘community‘ has no attribute ‘best_partition‘ [已解决]
-
【python】解决AttributeError: module ‘scipy.misc‘ has no attribute ‘toimage‘问题
-
AttributeError: 'module' object has no attribute 'main'
-
解决Keras报错AttributeError: 'NoneType' object has no attribute 'inbound_nodes'
-
解决'DataFrame' object has no attribute 'sort'
-
‘MyObject‘ object has no attribute ‘***‘
-
AttributeError: ‘NoneType‘ object has no attribute ‘origin‘解决办法