eelbrain.combine
- eelbrain.combine(items, name=None, check_dims=True, incomplete='raise', dim_intersection=False, to_list=False)
Combine a list of items of the same type into one item.
- Parameters
items (Iterable) – Sequence of data objects to combine (Dataset, Var, Factor, NDVar or Datalist). A sequence of numbers is converted to
Var
, a sequence of strings is converted toFactor
.name (str) – Name for the resulting data-object. If None, the name of the combined item is the common prefix of all items.
check_dims (bool) – For
NDVar
columns, check dimensions for consistency between items (e.g., channel locations in aSensor
). Default isTrue
. Set toFalse
to ignore mismatches.incomplete (Literal['raise', 'drop', 'fill in']) – Only applies when combining Datasets: how to handle variables that are missing from some of the input Datasets. With
"raise"
(default), raise aValueError
. With"drop"
, drop partially missing variables. With"fill in"
, retain partially missing variables and fill in missing values with empty values (""
for factors,NaN
for numerical variables).dim_intersection (bool) – Only applies to combining
NDVar
: normally, whenNDVar
have mismatching dimensions, aDimensionMismatchError
is raised. Withdim_intersection=True
, the intersection is used instead.to_list (bool) – Only applies to combining
NDVar
: normally, whenNDVar
have mismatching dimensions, aDimensionMismatchError
is raised. Withto_list=True
, theNDVar
are added aslist
ofNDVar
instead.
Notes
The info dict inherits only entries that are equal (
x is y or np.array_equal(x, y)
) for all items. Iflen(items)
is 1,items[0]
is returned directly.