eelbrain.table.cast_to_ndvar
- eelbrain.table.cast_to_ndvar(y, dim_values, match, sub=None, data=None, dim=None, unit='s', name=None)
Create an NDVar by converting a data column to a dimension
- Parameters:
dim_values (Var | str | Factor) – Location on the new dimension.
match (Factor | Interaction | NestedEffect | str) – Indicating rows which belong the the same case in the NDvar.
data (Dataset) – Dataset with data for operation.
dim (str) – Name for the new dimension. Use
dim='uts'to createUTStime dimension from scalardim_values.unit (str) – Unit for
UTSdimension (ignored otherwise).name (str) – Name for the new
NDVar(the default is the name ofdata).
- Returns:
Copy of
ds, aggregated overdim_values, and with anNDVarcontaining the values fromdataand a new dimension reflectingdim_values. Ifdim_valuesis a Factor, the new dimension isCategorial; ifdim_valuesis aVar, it isScalar. The new dimension’s name isdim. The only exception to this is that whendim='uts', the new dimension isUTSnamed'time'.- Return type:
short_ds
See also