median#
- 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=Falseafter the median got calculated.- Parameters:
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_dataobject, e.g. ‘channel’ or ‘trials’keeptrials (bool) – Set to
Falseto trigger additional trial averaging. Has no effect ifdim='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
StructDictor str) – In-place selection of subset of input data for processing. Please refer tosyncopy.selectdata()for further usage details.
- Returns:
res – New object with the median of the desired dimension
- Return type:
Syncopy data object