qq_20020827
2021-08-02 17:18
浏览 26
已结题

ValueError: ascending must be boolean你们有遇到过这个错误吗

```python
rs = pd.Series(cs[0]).sort_values(ascending=0)

top5 = rs.iloc[0:5]
top5

```出现错误
ValueError Traceback (most recent call last)
in
----> 1 rs = pd.Series(cs[0]).sort_values(ascending=0)
2
3
4 top5 = rs.iloc[0:5]
5 top5

C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\series.py in sort_values(self, axis, ascending, inplace, kind, na_position, ignore_index, key)
3269
3270 if not is_bool(ascending):
-> 3271 raise ValueError("ascending must be boolean")
3272
3273 if not ascending:

ValueError: ascending must be boolean

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

相关推荐 更多相似问题