scistag.filestag.bundlers.dataframe_bundler.DataFrameBundler

class DataFrameBundler[source]

Bases: object

Bundles and unpacks Pandas data, see Bundle

Methods

bundle

Bundles a Pandas DataFrame to bytes

unpack

Restores a Pandas DataFrame from bytes

Attributes

__dict__

__doc__

__module__

__weakref__

list of weak references to the object (if defined)

classmethod bundle(data, options=None)[source]

Bundles a Pandas DataFrame to bytes

Parameters
  • data (pd.DataFrame) – The data to be packed

  • options (BundlingOptions | None) – The bundling options

Return type

(str, bytes)

Returns

The packed data as single bytes strings

static unpack(data, options=None)[source]

Restores a Pandas DataFrame from bytes

Parameters
  • data (bytes) – The data to be unpacked

  • options (UnpackOptions | None) – The unpacking options

Return type

pd.DataFrame

Returns

The restored numpy array