系列'对象没有属性'顺序'

fik*_*a3e 2 python-3.6

我的代码是

disagreements = pivoted[pivoted.movie_id.isin(top_50.index)]["diff"]
disagreements.order().plot(kind="bar", figsize=[10,15])
Run Code Online (Sandbox Code Playgroud)

错误是

Series' object has no attribute 'order'
currently trying this on spider,python3.6. anybody with a solution please

小智 10

请检查使用过的Pandas库版本.如果您使用的是最新版本,则可以使用sort_values()方法.有关详细信息,请参阅 http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.sort_values.html