Python利用时间索引进行重采样


title: Python利用时间索引进行重采样
date: 2021-08-21 23:46:52
tags:

#Python利用时间索引进行重采样
import pandas as pd
data=pd.read_excel('tiod.xlsx',sheet_name='Sheet1')
data['date']=pd.date_range('19500101','20201001',freq='1M')
data=data.set_index('date')
data.resample('Y').mean().to_excel('tiod_annual.xlsx')

猜你喜欢

转载自blog.csdn.net/weixin_45577825/article/details/119879780
今日推荐