AttributeError: 'Series' object has no attribute 'order'

#根据active_titles进行过滤
rating_std_by_title = rating_std_by_title.ix[active_titles]

根据值对seris进行降序排序,结果报了一个错误

Traceback (most recent call last):
  File "E:/PythonDataAnalysis/MovieLens1M", line 60, in 
    print(rating_std_by_title.order(ascending = False)[:10])
  File "C:\Users\Administrator\venv\lib\site-packages\pandas\core\generic.py", line 4372, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'Series' object has no attribute 'order'
大概就是Seris对象没有order属性的意思,然后我百度是没有了一下,说是Python3.6之后的版本已经没有order属性了,尝试使用sort_values()方法就好了。


你可能感兴趣的:(Python教程)