保存

作者: 夏弘毅 | 来源:发表于2019-08-01 15:56 被阅读0次

    保存

    all_index.to_pickle('all_index')
     all_index = pd.read_pickle('all_index')
     import pickle
     with open('eods.pickle', 'w') as f:  # Python 3: open(..., 'wb')
         pickle.dump([locals()['eod_' + all_industry_index[i][4:6]] for i in range(len(all_industry_index))], f)
    
     with open('eods.pickle') as f:  # Python 3: open(..., 'rb')
         obj0, obj1, obj2 = pickle.load(f)
    
    保存变量
    var_name = ['market_view_' + all_industry_index[i][0:8] for i in range(len(all_industry_index))]
    import pickle
    with open('market_views.bin','wb') as f:
        pickle.dump(var_name,f)
    
    with open('market_views.bin') as f:
        var_name = pickle.load(f)
    

    相关文章

      网友评论

          本文标题:保存

          本文链接:https://www.haomeiwen.com/subject/bsqcdctx.html