python保存数据的各种方式比较(磁盘空间,时间消耗)
Posted MrCharles
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python保存数据的各种方式比较(磁盘空间,时间消耗)相关的知识,希望对你有一定的参考价值。
Npy and binary files are both really fast and small for dense data. If the data is sparse or very structured, you might want to use npz with compression, which’ll save a lot of space but cost some load time.
If portability is an issue, binary is better than npy. If human readability is important, then you’ll have to sacrifice a lot of performance, but it can be achieved fairly well using csv (which is also very portable of course).
https://stackoverflow.com/questions/9619199/best-way-to-preserve-numpy-arrays-on-disk/41425878#41425878
以上是关于python保存数据的各种方式比较(磁盘空间,时间消耗)的主要内容,如果未能解决你的问题,请参考以下文章
cProfile - 将数据保存在 Python 对象中/延迟写入磁盘