pkl文件的写入较简单,具体如下:环境: win7 32bit - Anaconda3-4.2.0-Windows-x86_64
- import numpy
- import pickle
- data = [[540,4742.91325,2328.635571,2570],
- [541,4614.539129,2308.227073,2552.9],
- [542,4456.322773,2286.485878,2540.1],
- [543,4298.430678,2264.266999,2535.2],
- [544,4224.017029,2253.302885,2538.2],
- [545,4216.006717,2251.466999,2544.3],
- [546,4263.533361,2260.612754,2551.5],
- [547,4368.689909,2283.421446,2561.8],
- [548,4480.593649,2311.079838,2572.7],
- [549,4584.961687,2346.834045,2581],
- [550,4679.07358,2388.548134,2585.1],
- [551,4790.547157,2444.55245,2588.8],
- [552,4889.457828,2492.07124,2593.5],
- [553,4974.637184,2531.361728,2597.7],
- [554,5039.632543,2557.057706,2598.8],
- [555,5080.237078,2571.110436,2598.8],
- [556,5056.74739,2569.131814,2598.7]]
- pickle_data = open('data.pkl','wb');
- pickle.dump(data, pickle_data);
- pickle_data.close();
复制代码
|