生成时间序列:
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 datetime t = datetime.date(datetime.date.today().year, datetime.date.today().month,datetime.date.today().day) print(t) 输出:2016-09-16start_day=start_day.strftime("%Y-%m-%d") end_day=end_day.strftime("%Y-%m-%d")
import datetime now = datetime.datetime.now() y = now.year m = now.month d = now.day
时间: 2024-10-07 20:11:36