首页 > 代码库 > tushrea知识笔记

tushrea知识笔记

生成时间序列:

dates = pandas.date_range(‘2013-01-01‘,periods = 6)

Pandas读取excel数据:

df=pd.read_excel("mystock.xls")

DF排序:

df=df.sort(‘data‘,ascending=False)

 获取单个年月日再组合:

import datetimet = datetime.date(datetime.date.today().year,                  datetime.date.today().month,datetime.date.today().day)print(t)输出:2016-09-16
start_day=start_day.strftime("%Y-%m-%d")
end_day=end_day.strftime("%Y-%m-%d")

 

import datetimenow = datetime.datetime.now()y = now.yearm = now.monthd = now.day

 

tushrea知识笔记