【发布时间】:2019-02-15 05:57:42
【问题描述】:
我有一个数据集,我试图在其中分解并按月计算出现次数。我还需要转换最终结果以添加每个月/发生的列
Report_ID Report_name timestamp
1 Profit 8/1/2018 06:10:40
2 Revenue 8/5/2018 09:25:45
1 Profit 8/29/2018 10:11:30
2 Revenue 9/1/2018 09:45:22
输出:
Report_ID 8/2018 9/2018
1 2 0
2 1 1
【问题讨论】:
-
您的数据是
pandas数据框还是其他格式? -
它会从一个 .xlsx 文件进入,然后通过 pd.read_excel() 读入 python
标签: python pandas count pandas-groupby