学习笔记15—Python 存储集
1、 save using pickle
with open('F:/BrainAging/result/ordered_data_final_just_TD_leaveOne.pickle', 'wb') as f:
pk.dump(ordered_data_final, f)
load using pickle
with open('F:/BrainAging/result/ordered_data_final_just_TD_leaveOne.pickle', 'rb') as f:
b = pk.load(f)
import pickle
a = 1
# 保存
with open('data.pickle', 'wb') as f:
pickle.dump(data, f)
# 读取
with open('data.pickle', 'rb') as f:
b = pickle.load(f)
作者:章光辉_数据分析师
链接:https://www.jianshu.com/p/1cdcb59def55
來源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。
import pickle a = 1 # 保存 with open('data.pickle', 'wb') as f: pickle.dump(data, f) # 读取 with open('data.pickle', 'rb') as f: b = pickle.load(f)
作者:章光辉_数据分析师
链接:https://www.jianshu.com/p/1cdcb59def55
來源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。