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
(self)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
(self[, variables])Returns a list of all stored DenseRunVariables.
get_sparse_variables
(self[, variables])Returns a list of all stored SparseRunVariables.
match_variables
(self, pattern[, …])Return columns whose names match the provided pattern.
merge_variables
(variables, \*\*kwargs)Concatenates Variables along row axis.
resample
(self[, sampling_rate, variables, …])Resample all dense variables (and optionally, sparse ones) to the specified sampling rate.
to_dense
(self[, sampling_rate, variables, …])Convert all contained SparseRunVariables to DenseRunVariables.
to_df
(self[, variables, format, fillna, …])Merge columns into a single pandas DataFrame.
all_dense
all_sparse
-
__init__
(self, variables, sampling_rate=None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
(self, variables[, sampling_rate])Initialize self.
all_dense
(self)all_sparse
(self)clone
(self)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
(self[, variables])Returns a list of all stored DenseRunVariables.
get_sparse_variables
(self[, variables])Returns a list of all stored SparseRunVariables.
match_variables
(self, pattern[, …])Return columns whose names match the provided pattern.
merge_variables
(variables, \*\*kwargs)Concatenates Variables along row axis.
resample
(self[, sampling_rate, variables, …])Resample all dense variables (and optionally, sparse ones) to the specified sampling rate.
to_dense
(self[, sampling_rate, variables, …])Convert all contained SparseRunVariables to DenseRunVariables.
to_df
(self[, variables, format, fillna, …])Merge columns into a single pandas DataFrame.