syncopy.median(spy_data, dim, keeptrials=True, parallel=None, select=None, **kwargs)[source]#

Calculates the median along arbitrary dimensions of a Syncopy data object spy_data.

Additional trial averaging can be performed with keeptrials=False after the median got calculated.

  • spy_data (Syncopy data object) – The object where a median is to be computed.

  • dim (str) – Dimension label over which to calculate the statistic. Must be present in the spy_data object, e.g. ‘channel’ or ‘trials’

  • keeptrials (bool) – Set to False to trigger additional trial averaging. Has no effect if dim='trials'.

  • parallel (None or bool) – If None (recommended), processing is automatically performed in parallel (i.e., concurrently across trials/channel-groups), provided a dask parallel processing client is running and available. Parallel processing can be manually disabled by setting parallel to False. If parallel is True but no parallel processing client is running, computing will be performed sequentially.

  • select (dict or StructDict or str) – In-place selection of subset of input data for processing. Please refer to syncopy.selectdata() for further usage details.


res – New object with the median of the desired dimension

Return type:

Syncopy data object