eelbrain.table.melt_ndvar

eelbrain.table.melt_ndvar(ndvar, dim=None, cells=None, ds=None, varname=None, labels=None)

Transform data to long format by converting an NDVar dimension into a variable

Parameters
  • ndvar (NDVar | str) – The NDVar (or name of the NDVar in ds).

  • dim (str) – The name of the dimension that should be unwrapped (optional if ndvar has only one non-case dimension).

  • cells (sequence) – The values on dim that should be included in the output Dataset (default is to include all values).

  • ds (Dataset) – Dataset with additional variables that should be included in the long table.

  • varname (str) – Name for the transformed ndvar (default is ndvar.name).

  • labels (dict | callable) – Mapping or function to create labels for dim levels.

Returns

long_table – Dataset in long format.

Return type

Dataset

Examples

See Compare topographies.