在 Python 中以 .pkl 格式保存文件比以 .txt 或 .csv 格式保存文件有什么优点?
.pkl 可以序列化非常广泛的对象,而不仅仅是文本数据。
Although you only ask about the advantages, I would like to mention the disadvantages first.
Con:
Pro:
PKL is faster.
PKL can store any binary subject.
JSON is a text serialization format (it outputs unicode text, although most of the time it is then encoded to utf-8), while pickle is a binary serialization format;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.