我有一个 pandas 数据框,它显示 1990 年的每小时温度读数,如下所示:
Date and time Dry bulb temperature
0 1990-01-01 00:00:00 8.2
1 1990-01-01 01:00:00 8.1
2 1990-01-01 02:00:00 8.3
3 1990-01-01 03:00:00 8.5
4 1990-01-01 04:00:00 8.8
... ... ...
8755 1990-12-31 19:00:00 3.0
8756 1990-12-31 20:00:00 2.6
8757 1990-12-31 21:00:00 2.8
8758 1990-12-31 22:00:00 4.2
8759 1990-12-31 23:00:00 2.0
我想每 24 小时计算一次最大干球温度并获得相应的日期和时间。我该怎么办?
到目前为止,我有:
o=[]
for i in range(0, len(Dataframe['Dry bulb temperature']), 24):
ymax = np.max(Dataframe['Dry bulb temperature'][i:i+24])
o.append(ymax)
print(o)
它每 24 小时给出一次最高温度,如下所示:
[9.7, 9.9, 8.4, 10.4, 11.2, 12.0, 10.5, 10.7, 11.9, 12.0, 11.5, 11.4, 10.2, 10.9, 13.6, 11.5, 9.6, 10.9, 10.8, 12.3, 12.3, 12.2, 11.5, 7.9, 12.7, 6.0, 9.4, 8.2, 9.8, 10.6, 9.6, 8.8, 10.8, 8.6, 11.9, 11.7, 12.2, 13.8, 12.5, 10.8, 13.2, 8.2, 7.4, 12.1, 12.4, 8.6, 7.7, 12.3, 13.3, 12.3, 13.1, 12.0, 12.7, 11.5, 12.7, 12.5, 12.5, 8.7, 13.2, 7.7, 9.0, 10.1, 10.6, 10.9, 11.9, 11.4, 13.3, 12.2, 15.0, 14.1, 13.1, 12.9, 13.7, 12.7, 12.7, 16.3, 14.9, 12.8, 11.8, 14.2, 11.5, 11.7, 10.4, 10.1, 9.9, 9.6, 10.6, 12.7, 16.0, 15.3, 14.4, 14.2, 8.6, 7.0, 9.8, 11.6, 12.6, 11.1, 12.3, 12.2, 14.8, 15.2, 11.3, 12.1, 12.0, 12.3, 11.5, 10.8, 10.0, 11.7, 15.3, 12.9, 17.0, 17.6, 18.9, 14.2, 13.3, 14.9, 17.8, 20.6, 21.9, 24.1, 26.8, 25.4, 24.9, 23.5, 16.4, 14.9, 13.8, 14.2, 17.7, 17.9, 16.8, 15.7, 16.3, 18.9, 19.4, 18.3, 14.5, 17.6, 18.8, 18.1, 21.9, 18.2, 14.7, 14.9, 19.4, 20.0, 14.9, 18.9, 16.8, 17.6, 15.8, 14.6, 17.0,
我想以表格形式获取每个最高温度的相应日期:
[9.7,1990-01-02 03:00:00],...,etc.
肥皂起泡泡
守着星空守着你
相关分类