【发布时间】:2021-08-16 11:58:21
【问题描述】:
我有这样的数据:其中 total_percentage_sale 是该时间段内产品的销售百分比。
date. product sale total_percentage_sale
2019-01-01. productA. 12. 30
2019-01-01. productB. 10. 25
2019-02-01. productC. 8. 20
2019-02-01. productD. 10. 25
我想从 total_percentage_sale 列中获取滞后的月平均值。
【问题讨论】:
-
您的意思是对于特定的
year/month group,total_percentage_sale的average是什么? -
特定月份。总销售百分比的平均值为 25,但 1 月的平均值为 27.5,2 月的平均值为 22.5
标签: python pandas numpy data-science