eelbrain.table.cast_to_ndvar¶
-
eelbrain.table.
cast_to_ndvar
(data, dim_values, match, sub=None, ds=None, dim=None, name=None)¶ Create an NDVar by converting a data column to a dimension
- Parameters
data (Var) – Data to be cast.
dim_values (Var | Factor) – Location on the new dimension.
match (Factor | Interaction) – Indicating rows which belong the the same case in the NDvar.
sub (index) – Use a subset of the data.
ds (Dataset) – Dataset with data for operation.
dim (str) – Name for the new dimension. Use
dim='uts'
to createUTS
time dimension from scalardim_values
.name (str) – Name for the new
NDVar
(the default is the name ofdim_values
).
- Returns
short_ds – Copy of
ds
, aggregated overdim_values
, and with anNDVar
containing the values formdata
and a new dimension reflectingdim_values
. Ifdim_values
is a Factor, the new dimension isCategorial
; ifdim_values
is aVar
, it isScalar
. The new dimension’s name isdim
. The only exception to this is that whendim='uts'
, the new dimension isUTS
named'time'
.- Return type