MsgPack¶
-
class
numcodecs.msgpacks.
MsgPack
(encoding='utf-8')¶ Codec to encode data as msgpacked bytes. Useful for encoding an array of Python string objects.
Notes
Requires msgpack-python to be installed.
Examples
>>> import numcodecs >>> import numpy as np >>> x = np.array(['foo', 'bar', 'baz'], dtype='object') >>> codec = numcodecs.MsgPack() >>> codec.decode(codec.encode(x)) array(['foo', 'bar', 'baz'], dtype=object)
-
codec_id
= 'msgpack'¶
-
encode
(buf)¶
-
decode
(buf, out=None)¶
-
get_config
()¶
-
from_config
(config)¶ Instantiate codec from a configuration object.
-