将大熊猫系列汇总到数据框架和视觉表示
我有三个pandas系列,称为:col_data
,c_pv_data
和c_ELEC_DATA
。每个人都有以下值:
Col_data:
0 625814.205486
1 782267.756857
2 938721.308229
Name: 7, dtype: object
C_PV_data:
0 2039032.206909
1 2548790.258636
2 3058548.310363
Name: 3, dtype: object
C_elec_data:
0 1337523.743009
1 1671904.678761
2 2006285.614513
Name: 0, dtype: object
我想将它们汇总到单个数据框中,将数据框导出到 .xlsx 文件,其中每列称为变量。例如:
COL_DATA | C_PV_DATA | C_ELEC_DATA |
---|---|---|
625814.205486 | 2039032.206909 | 1337523.743009 |
782267.756857 | 的 | 值 |
。 | 高高 | 614513 |
最后,我想用一个图形表示每个列,其中中心值为一条线,而在该线上的两个点,最低和 例如,图形将是这样的:
I have three pandas Series, called: Col_data
, C_PV_data
and C_elec_data
. Each one has these values:
Col_data:
0 625814.205486
1 782267.756857
2 938721.308229
Name: 7, dtype: object
C_PV_data:
0 2039032.206909
1 2548790.258636
2 3058548.310363
Name: 3, dtype: object
C_elec_data:
0 1337523.743009
1 1671904.678761
2 2006285.614513
Name: 0, dtype: object
I would like to aggregate them into a single DataFrame, to export that DataFrame to a .xlsx file, in which each column is called as the variable. For instance:
Col_data | C_PV_data | C_elec_data |
---|---|---|
625814.205486 | 2039032.206909 | 1337523.743009 |
782267.756857 | 2548790.258636 | 1671904.678761 |
938721.308229 | 3058548.310363 | 2006285.614513 |
Finally, I would like to represent each column with a graph in which the central value is a line, and two dots over that line, for the lowest and hights value. For instance, the graph would be something like this:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然,您要去:
init
作为
df
旁注:我总是不喜欢重复。以下替代方案是干燥的(不要重复自己),但也许不清楚:
假设
您已经安装了
openpyxl
已安装:box plot
edit :(并保存保存作为PNG)
Sure, here you go:
Init
As a
df
Side note: I always dislike repeats. The following alternative to the above is DRY (Don't Repeat Yourself), but less clear perhaps:
To xlsx
Assuming you have
openpyxl
installed:Box plot
Edit: (and save as PNG)