mvpa2.base.dataset.hstack¶
-
mvpa2.base.dataset.
hstack
(datasets, a=None, sa='drop_nonunique')¶ Stacks datasets horizontally (appending features).
All datasets must have an identical set of sample attributes (matching keys, not values), otherwise a ValueError will be raised. See
a
argument documentation for transferring dataset attributes, andsa
argument for sample attributes – by default sample attributes which differ in any input dataset from the others would be dropped.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.
sa: {‘update’, ‘drop_nonunique’}, (default: ‘update’)
Indicate which feature attributes are stored in merged dataset. If ‘update’ - attributes are updated while growing the dataset. If ‘drop_nonunique’, attribute would be dropped from the dataset if its value differs across datasets for any sample.
Returns: AttrDataset (or respective subclass)