Transpose#

class dpeeg.transforms.Transpose(dims: list[int] | None = None, key: str = 'edata')[source]#

Data dims transposed.

By default, the EEG data (edata) of eegdata are transposed.

Parameters:
  • dims (tuple or list of int, optinal) – A tuple or list contains a permutation of [0,1,…,N-1] where N is the number of dims of the key values. The i``^th dim of the value will correspond to the axis numbered ``dims[i] of the input. If not specified, reverse the dims order by default.

  • key (str) – The key of the eegdata value to be transformed.

Examples

>>> eegdata = dpeeg.EEGData(edata=np.random.randn(16, 1, 3, 10),
...                         label=np.random.randint(0, 3, 16))
>>> transforms.Transpose()(eegdata, verbose=False)
[edata=(10, 3, 16), label=(16,)]