brainbox.core

Creates core data types and functions which support all of brainbox.

Classes

Bunch

A subclass of dictionary with an additional dot syntax.

TimeSeries

A subclass of dict with dot syntax, enforcement of time stamping

class Bunch(*args, **kwargs)[source]

Bases: dict

A subclass of dictionary with an additional dot syntax.

copy()[source]

Return a new Bunch instance which is a copy of the current Bunch instance.

to_df()[source]

Attempts to returns a pandas.DataFrame if all elements are arrays of the same length Returns the original bunch if it can’t

save(npz_file, compress=False)[source]

Saves a npz file containing the arrays of the bunch.

Parameters
  • npz_file – output file

  • compress – bool (False) use compression

Returns

None

static load(npz_file)[source]

Loads a npz file containing the arrays of the bunch.

Parameters

npz_file – output file

Returns

Bunch

class TimeSeries(times, values, columns=None, *args, **kwargs)[source]

Bases: dict

A subclass of dict with dot syntax, enforcement of time stamping

copy()[source]

Return a new TimeSeries instance which is a copy of the current TimeSeries instance.