【发布时间】:2019-02-23 06:40:00
【问题描述】:
我正在尝试计算每个日期的值,以计算女巫季度的频率很高我尝试这些方法到目前为止不起作用...请帮助 :) 谢谢。 注意:时间是'系列'对象
stime=df['timestamp']
#print (df['timestamp'].filter(like='08', axis=0)
#stime.filter(like='2018-07-18')
#stime.between_date('2018-01-01','2018-02-01', include_start=True, include_end=True)
#stime.month
【问题讨论】:
-
嗨。请花时间阅读how to provide a great pandas example 上的这篇文章以及如何提供minimal, complete, and verifiable example 并相应地修改您的问题。 how to ask a good question 上的这些提示也可能有用。
-
这是您要找的东西吗:
df.set_index('timestamp').resample('Q').size()? -
@ChrisA 我的数据包含列时间戳 ex:'2018-08-29'
-
@ChrisA 我想计算我在 8 月份有多少 = 8(月)等所有月份来计算一年中的季度
标签: python-3.x pandas series