首页 > 其他分享 >58.获取指定日期区间的数据

58.获取指定日期区间的数据

时间:2022-11-27 09:55:29浏览次数:33  
标签:25 58 05 df 获取 日期 2020 pd 数据

 

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

#获取指定区域的数据
import pandas as pd 
pd.set_option('display.unicode.east_asian_width',True) # 规整格式
df=pd.read_excel('msb课程销售记录.xlsx')
#df.head()
df=df[['订单付款时间','会员名','实际支付金额','联系手机','学员姓名']]
df=df.sort_values(by=['订单付款时间'])
#将日期设置为索引
df=df.set_index('订单付款时间')
#df.['2020']#求2020年数据
#df.['2020-05'] #查看2020-05月数据
#df['2020-05-25':'2020-05-25'] #查看2020-05-25日的数据
df['2020-06-01':'2020-06-30']

  

标签:25,58,05,df,获取,日期,2020,pd,数据
From: https://www.cnblogs.com/988MQ/p/16929049.html

相关文章