Hello Mat

 找回密码
 立即注册
查看: 5216|回复: 0

pkl文件写入

[复制链接]

1323

主题

1551

帖子

0

金钱

管理员

Rank: 9Rank: 9Rank: 9

积分
22647
发表于 2017-8-13 10:05:56 | 显示全部楼层 |阅读模式
pkl文件的写入较简单,具体如下:环境: win7 32bit - Anaconda3-4.2.0-Windows-x86_64

  1. import numpy
  2. import pickle
  3. data = [[540,4742.91325,2328.635571,2570],
  4. [541,4614.539129,2308.227073,2552.9],
  5. [542,4456.322773,2286.485878,2540.1],
  6. [543,4298.430678,2264.266999,2535.2],
  7. [544,4224.017029,2253.302885,2538.2],
  8. [545,4216.006717,2251.466999,2544.3],
  9. [546,4263.533361,2260.612754,2551.5],
  10. [547,4368.689909,2283.421446,2561.8],
  11. [548,4480.593649,2311.079838,2572.7],
  12. [549,4584.961687,2346.834045,2581],
  13. [550,4679.07358,2388.548134,2585.1],
  14. [551,4790.547157,2444.55245,2588.8],
  15. [552,4889.457828,2492.07124,2593.5],
  16. [553,4974.637184,2531.361728,2597.7],
  17. [554,5039.632543,2557.057706,2598.8],
  18. [555,5080.237078,2571.110436,2598.8],
  19. [556,5056.74739,2569.131814,2598.7]]

  20. pickle_data = open('data.pkl','wb');
  21. pickle.dump(data, pickle_data);
  22. pickle_data.close();
复制代码





算法QQ  3283892722
群智能算法链接http://halcom.cn/forum.php?mod=forumdisplay&fid=73
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Python|Opencv|MATLAB|Halcom.cn ( 蜀ICP备16027072号 )

GMT+8, 2024-11-23 00:06 , Processed in 0.221548 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表