mvpa2.generators.resampling.get_limit_filter

mvpa2.generators.resampling.get_limit_filter(limit, collection)

Create a filter array from a limit definition.

Parameters:

limit : None or str or list or dict

If None all elements will be included in the filter. If a single attribute name is given, its unique values will be used to define chunks of data that are marked in the filter as unique integers. If a list given, then combination of those attributes is used as a pair. Finally, if a dictionary is provided, its keys define attribute names and its values (single value or sequence thereof) attribute value, where all key-value combinations across all given items define a “selection” of elements to be included in the filter (OR combination).

collection : Collection

Dataset attribute collection instance that contains all attributes referenced in the limit specification, as well as defines the shape of the filter.

Returns:

array

This array is either boolean, where a True elements represent including in the filter, or the array is numerical, where its unique integer values define individual chunks of a filter.