Pandas msgpack vs pickle

后端 未结 1 1667
-上瘾入骨i
-上瘾入骨i 2020-12-30 00:01

msgpack in Pandas is supposed to be a replacement for pickle.

Per the Pandas docs on msgpack:

This is a lightweight

相关标签:
1条回答
  • 2020-12-30 00:42

    Pickle is better for the following:

    1. Numerical data or anything that uses the buffer protocol (numpy arrays) (though only if you use a somewhat recent protocol=)
    2. Python specific objects like classes, functions, etc.. (although here you should look at cloudpickle)

    MsgPack is better for the following:

    1. Cross language interoperation. It's an alternative to JSON with some improvements
    2. Performance on text data and Python objects. It's a decent factor faster than Pickle at this under any setting.

    As @Jeff noted above this blogpost may be of interest

    0 讨论(0)
提交回复
热议问题