python - 在 Python 中使用 Group by 缩放坐标轴
问题描述
我的 Y 轴包括从 0 到 250 万。我可以把这个数字除以 1000
我如何在这段代码中实现?我的代码如下。
df.groupby('CASE_STATUS')['Index'].nunique().plot(kind='bar',fontsize=12)
正如你在图片中看到的,我想用一个特定的数字来划分 Y 轴
解决方案
这还不足以解决问题:
(df.groupby('CASE_STATUS')['Index'].nunique()/1000).plot(kind='bar',fontsize=12)
推荐阅读
- sql - SQL LIKE 中的多个值
- javascript - Javascript 触发两次 Wordpress 管理元框
- javascript - 谷歌地图,在窗口范围内获取所有标记后,信息窗口无法使用多个标记
- asp.net-core - Blazor @page 路由 url 用变量定义
- json - Linux 中 JSON 的 YAML 格式
- javascript - Discord.js 无法读取未定义的属性 id
- reactjs - 在 useCallback 中反转布尔状态值
- python - 在python中没有发现新函数
- matlab - 如何使用循环来拆分 Matlab 中的数据?
- python - 如何阅读以下代码行?