【问题标题】:Using .resemple() in python to go from weekly to monthly time series在 python 中使用 .resemple() 从每周到每月时间序列
【发布时间】:2022-12-11 02:57:02
【问题描述】:

是否可以使用 .resample() 在每周时间序列的一个月中进行最后一次观察,以从每周时间序列创建每月时间序列?我不想求和或平均任何东西,只取每个月的最后一次观察 谢谢你。

【问题讨论】:

    标签: python pandas-resample


    【解决方案1】:

    根据您的需要和文档描述的内容,您可以尝试以下操作:

    data[COLUMN].resample('M', convention='end')
    

    试试看并更新我们!

    参考https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.resample.html

    【讨论】:

      猜你喜欢
      • 2014-08-17
      • 2021-05-21
      • 1970-01-01
      • 2013-04-30
      • 2022-11-21
      • 2016-06-29
      • 2020-09-20
      • 2020-05-10
      • 2020-06-29
      相关资源
      最近更新 更多