|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 sungl123456 于 2022-5-8 17:28 编辑
我想用以下语句解压一个pickle.
import pickle
m = open("pyl_output.txt","w+")
pickle_file = open("pyl_output.pickle","rb")
my_list = pickle.load(pickle_file)
m.write(str(my_list))
m.close()
pickle_file.close()
打开txt后如下:
A6 A7 A8-1 A8-2 A8 A9 ... I7 I8 I9 I10 I11 I12
Sample ...
1 0.60118 1.78064 0 0 2.99760 1.62842 ... 10.85256 4.84840 2.30329 2.65498 1.73356 0.08996
2 0.59462 1.63383 0 0 3.04823 3.38542 ... 5.30031 6.21892 5.44067 5.16631 1.50699 0.49032
3 0.29054 1.58722 0 0 2.96846 2.70051 ... 7.32146 5.10571 3.09381 3.50391 1.54973 0.05186
4 0.49126 1.62644 0 0 2.30577 1.47264 ... 4.39631 5.02794 3.50998 2.26918 1.88049 0.00143
5 0.58439 1.51815 0 0 2.55924 2.27307 ... 7.92020 5.64259 3.09450 2.98510 1.29679 0.00000
... ... ... ... ... ... ... ... ... ... ... ... ... ...
106 0.13744 0.40451 0 0 0.32308 1.52875 ... 1.34453 0.90167 0.29019 2.11610 2.23474 0.00000
107 0.19984 0.64972 0 0 0.83333 1.76897 ... 2.83204 1.69105 1.54248 2.64955 1.13553 0.00000
108 0.35350 0.85926 0 0 1.42826 1.28576 ... 8.02957 3.87080 2.60775 2.35449 0.87326 0.30150
109 0.17400 0.46200 0 0 0.65000 0.61600 ... 13.33250 3.60725 1.57282 1.08000 0.35600 0.12200
110 0.33360 0.87840 0 0 1.45681 1.41420 ... 9.55504 4.14480 2.68599 2.46000 0.83700 0.26560
[110 rows x 37 columns]
求助问题:pickle解压怎么能够将全部内容都拿出来呢
pyl_output.pickle我放到百度网盘里了,链接如下:
链接:https://pan.baidu.com/s/16hL-abzn39noEk-K3ID6yA
提取码:bvyp
|
|