monthly_dividend
1994 10 NaN
11 NaN
12 NaN
12 NaN
...
2012 4 NaN
5 NaN
6 NaN
7 1.746622
8 1.607685
9 1.613936
10 1.620187
11 1.626125
12 1.632375
2013 1 1.667792
2 1.702897
3 1.738314
4 1.773731
5 1.808835
6 1.844252
Length: 225
我有类似于上面的代码。这是一个groupedbydataframe,不过我想再次将其转换成常规的TimeSeries。asfreq('M')不再适用于groupedby,所以我不确定是否有简单的方法来转换它。在
^{pr2}$
创建您的顶级数据
这将创建一个monthly freq的PeriodIndex。注意,在索引上迭代生成元组(作为整数)
^{pr2}$与DateTimeIndex的直接对话
现在你可以做了
to_timestamp
通常返回月的第一天 要返回结尾,请传递how='e'
相关问题 更多 >
编程相关推荐