首页 > 解决方案 > 在 Python 中使用 Group by 缩放坐标轴

问题描述

我的 Y 轴包括从 0 到 250 万。我可以把这个数字除以 1000

我如何在这段代码中实现?我的代码如下。

df.groupby('CASE_STATUS')['Index'].nunique().plot(kind='bar',fontsize=12)

正如你在图片中看到的,我想用一个特定的数字来划分 Y 轴

https://i.stack.imgur.com/o83Hs.png][1]

标签: pythonpandas

解决方案


这还不足以解决问题:

(df.groupby('CASE_STATUS')['Index'].nunique()/1000).plot(kind='bar',fontsize=12)

推荐阅读