brainbox.core.core¶
Creates core data types and functions which support all of brainbox.
Functions
Performs intersection on multiple columns arrays a0 and a1 :param a0: :param a1: :return: intesection :return: index of a0 such as intersection = a0[ia, :] :return: index of b0 such as intersection = b0[ib, :] |
|
equivalent of np.isin but returns indices as in the matlab ismember function returns an array containing logical 1 (true) where the data in A is B also returns the location of members in b such as a[lia] == b[locb] :param a: 1d - array :param b: 1d - array :return: isin, locb |
|
Equivalent of np.isin but returns indices as in the matlab ismember function returns an array containing logical 1 (true) where the data in A is B also returns the location of members in b such as a[lia, :] == b[locb, :] :param a0: 2d array :param a1: 2d array :return: isin, locb |
Classes
A subclass of dictionary with an additional dot syntax. |
|
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.
-
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
-
-
class
TimeSeries
(times, values, columns=None, *args, **kwargs)[source]¶ Bases:
dict
A subclass of dict with dot syntax, enforcement of time stamping
-
ismember
(a, b)[source]¶ equivalent of np.isin but returns indices as in the matlab ismember function returns an array containing logical 1 (true) where the data in A is B also returns the location of members in b such as a[lia] == b[locb] :param a: 1d - array :param b: 1d - array :return: isin, locb
-
ismember2d
(a0, a1)[source]¶ Equivalent of np.isin but returns indices as in the matlab ismember function returns an array containing logical 1 (true) where the data in A is B also returns the location of members in b such as a[lia, :] == b[locb, :] :param a0: 2d array :param a1: 2d array :return: isin, locb