2024-04-19 10:32:13 发布
网友
数据不一致。你知道吗
我尝试用过滤数据帧 df.Timestamp.dt.hour只给出几个小时,df.Timestamp.dt.minute只给出几分钟。你知道吗
df.Timestamp.dt.hour
df.Timestamp.dt.minute
例如,我需要过滤每一个小时的最后一个条目,比如1:58,2:54,3:36,4:44等等
我只需要更有效的方法,而不是解释:)
我认为这应该管用:
df.sort_values('Date').groupby([df['Date'].dt.date, df['Date'].dt.hour], as_index=False).last()
我认为这应该管用:
相关问题 更多 >
编程相关推荐