mvpa2.mappers.filters.vstack

mvpa2.mappers.filters.vstack(datasets, a=None)

Stacks datasets vertically (appending samples).

Feature attribute collections are merged incrementally, attribute with identical keys overwriting previous ones in the stacked dataset. All datasets must have an identical set of sample attributes (matching keys, not values), otherwise a ValueError will be raised. No dataset attributes from any source dataset will be transferred into the stacked dataset. If all input dataset have common dataset attributes that are also valid for the stacked dataset, they can be moved into the output dataset like this:

ds_merged = vstack((ds1, ds2, ds3))
ds_merged.a.update(ds1.a)
Parameters:

datasets : tuple

Sequence of datasets to be stacked.

a: {‘unique’,’drop_nonunique’,’uniques’,’all’} or True or False or None (default: None) :

Indicates which dataset attributes from datasets are stored in merged_dataset. If an int k, then the dataset attributes from datasets[k] are taken. If ‘unique’ then it is assumed that any attribute common to more than one dataset in datasets is unique; if not an exception is raised. If ‘drop_nonunique’ then as ‘unique’, except that exceptions are not raised. If ‘uniques’ then, for each attribute, any unique value across the datasets is stored in a tuple in merged_datasets. If ‘all’ then each attribute present in any dataset across datasets is stored as a tuple in merged_datasets; missing values are replaced by None. If None (the default) then no attributes are stored in merged_dataset. True is equivalent to ‘drop_nonunique’. False is equivalent to None.

Returns:

AttrDataset (or respective subclass) :