python - 将图表从一个数据框中拆分为不同的类别
问题描述
如何使用 4 个不同的图表来显示 4 个不同地区(中西部、东北部、南部、西部)的不同收入?
我使用了 df.plot() 但它只显示了一行,其中包含来自所有 4 个地区的所有收入。
Region Revenue
Date
2018-12-31 Midwest 652.0
2018-12-31 South 9465.3
2018-12-31 West 329.5
2018-12-31 Northeast 94063.0
2019-01-07 Midwest 2793.0
2019-01-07 South 20220.00
2019-01-07 Northeast 2544.75
2019-01-07 West 22342.35
2019-01-14 South 23434.75
2019-01-14 Midwest 23429.50
2019-01-14 West 2292.15
2019-01-14 Northeast 24520.50
2019-01-21 West 2477.00
2019-01-21 South 22355.25
2019-01-21 Midwest 28666.00
解决方案
推荐阅读
- javascript - 从 chart.js 图中删除 %
- list - 在这个问题中,nil 是可能的输出吗?
- python - R 找不到 conda 函数:安装 ee_grab 时出错
- perl - 是否有类似 PySimpleGUI for Perl 的工具?
- firebase - 状态不会完全改变
- php - 如何在ckfinder中显示所有文件夹、子文件夹和文件
- javascript - 为什么我完成的种子(有时)没有写入磁盘?
- android - Android Studio:在回收站视图内的框架布局内绘制右上角的功能区和星号
- jupyter-notebook - 有谁知道为什么 Jupyter 笔记本快捷方式不起作用?
- php - 如何使用 PHP 将 / 之后的所有内容保存到变量中?