使用Pandas绘图时如何消除相对偏移?

2024-06-01 02:12:02 发布

您现在位置:Python中文网/ 问答频道 /正文

我想用熊猫来绘制这些数据:

df['SGP_sum'].iloc[0:16] = 
Date
2018-01-01 00:00:00     99.998765
2018-01-01 01:00:00     99.993401
2018-01-01 02:00:00    100.005571
2018-01-01 03:00:00    100.027737
2018-01-01 04:00:00    100.022474
2018-01-01 05:00:00    100.039800
2018-01-01 06:00:00    100.043310
2018-01-01 07:00:00    100.045207
2018-01-01 08:00:00    100.045201
2018-01-01 09:00:00    100.043810
2018-01-01 10:00:00    100.042977
2018-01-01 11:00:00    100.054589
2018-01-01 12:00:00    100.052009
2018-01-01 13:00:00    100.040163
2018-01-01 14:00:00    100.009129
2018-01-01 15:00:00     99.975595
Name: SGP_sum, dtype: float64

但当我绘制它时,我看到的是:(我在显示中得到负值)

df['SGP_sum'].iloc[0:16].plot()

enter image description here


Tags: 数据namedfdateplot绘制sgpsum