【发布时间】:2018-09-27 14:45:22
【问题描述】:
我在一个大型 csv 文件中有一个列,其时间戳格式为 %H:%M:%S。从时间戳列表中获取聚合(如平均值、中值、25%、75% 等)的最佳方法是什么。
df = pd.DataFrame({'key': ['a', 'b', 'c'], 'value': [5, 4, 3], 'time1':['9:30:41', '10:00:56', '13:01:09']})
【问题讨论】:
-
你想如何聚合它们?以分钟、小时、准确时间为单位……?
-
时间戳更好
标签: pandas dataframe timestamp string-aggregation