如何在 python 中平滑我的邮票日期字段

How to smooth my stamp date field in python

我有数据(日期时间戳)和相应的值。具有一系列格式为 (dd/mm/yyyy hh:mm: ss) 的日期字段,某些行具有 3 个或更多值。 python 中有什么方法可以在同一小时取平均值并将其与小时 hh:00:00.

一起保存在一行中
Example
01/01/2019 01:13       35 **
01/01/2019 01:38       37 **
01/01/2019 02:03       45 **
01/01/2019 02:15       46 **
01/01/2019 02:40       55 **

并且需要像 :

01/01/2019 01:00       36 **
01/02/2019 02:00       50

谢谢

回答如下:-

df.set_index('Date').Count.resample('H').mean()