Unsqueeze#

class dpeeg.transforms.Unsqueeze(key: str = 'edata', dim: int = 1)[source]#

Insert a dimension on the data.

This transform is usually used to insert a empty dimension on signals.

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

  • dim (int) – Position in the expanded dim where the new dim is placed.

Returns:

data – Transformed eegdata.

Return type:

eegdata or dataset

Examples

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