bids.variables.BIDSRunVariableCollection

class BIDSRunVariableCollection(variables, sampling_rate=None)[source]

A container for one or more RunVariables–i.e., Variables that have a temporal dimension.

Parameters
  • variables (list) – A list of SparseRunVariable and/or DenseRunVariable.

  • sampling_rate (float) – Sampling rate (in Hz) to use when working with dense representations of variables. If None, defaults to 10.

Notes

Variables in the list must all be at the ‘run’ level. For other levels (session, subject, or dataset), use the BIDSVariableCollection.

Methods

clone()

Returns a shallow copy of the current instance, except that all variables are deep-cloned.

from_df(data[, entities, source])

Create a Collection from a pandas DataFrame.

get_dense_variables([variables])

Returns a list of all stored DenseRunVariables.

get_sparse_variables([variables])

Returns a list of all stored SparseRunVariables.

match_variables(pattern[, return_type, ...])

Return columns whose names match the provided pattern.

merge_variables(variables, **kwargs)

Concatenates Variables along row axis.

resample([sampling_rate, variables, ...])

Resample all dense variables (and optionally, sparse ones) to the specified sampling rate.

to_dense([sampling_rate, variables, ...])

Convert all contained SparseRunVariables to DenseRunVariables.

to_df([variables, format, fillna, ...])

Merge columns into a single pandas DataFrame.

all_dense

all_sparse

__init__(variables, sampling_rate=None)[source]

Methods

__init__(variables[, sampling_rate])

all_dense()

all_sparse()

clone()

Returns a shallow copy of the current instance, except that all variables are deep-cloned.

from_df(data[, entities, source])

Create a Collection from a pandas DataFrame.

get_dense_variables([variables])

Returns a list of all stored DenseRunVariables.

get_sparse_variables([variables])

Returns a list of all stored SparseRunVariables.

match_variables(pattern[, return_type, ...])

Return columns whose names match the provided pattern.

merge_variables(variables, **kwargs)

Concatenates Variables along row axis.

resample([sampling_rate, variables, ...])

Resample all dense variables (and optionally, sparse ones) to the specified sampling rate.

to_dense([sampling_rate, variables, ...])

Convert all contained SparseRunVariables to DenseRunVariables.

to_df([variables, format, fillna, ...])

Merge columns into a single pandas DataFrame.