load_data.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:Book_DeepLearning_Practice 作者: wac81 项目源码 文件源码
def download_economy():
    import tushare as ts
    path = './data/'
    ts.get_money_supply().to_csv(path+'money_supply.csv')
    ts.get_gdp_quarter().to_csv(path+'gdp_quarter.csv')
    ts.get_gdp_year().to_csv(path + 'gdp_year.csv')
    ts.get_cpi().to_csv(path+'cpi.csv')
    # ts.get_hist_data('sz').to_csv(path + 'sz.csv')
    # ts.get_hist_data('sh').to_csv(path + 'sh.csv')

    # import time
    import datetime
    # now_year = time.localtime().tm_year
    # now_mon = time.localtime().tm_mon
    # now_day = time.localtime().tm_mday
    years = 3
    start = datetime.datetime.today().date() + datetime.timedelta(-365*years)
    end = datetime.datetime.today().date()
    ts.get_k_data('399001',  start=str(start), index=True).to_csv(path + 'sz.csv')  #??2? ,
    ts.get_k_data('000001',  start=str(start), index=True).to_csv(path + 'sh.csv')
    #??????
    ts.get_rrr().to_csv(path + 'rrr.csv')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号