skneuromsi.core.ndresult.stats_acc module
Stats helper for the Result object.
- class skneuromsi.core.ndresult.stats_acc.ResultStatsAccessor(result)[source]
Bases:
AccessorABCCalculate basic statistics of the result.
Kind of statistic to produce: - describe - count - mean - std - min - max - dimmin - dimmax - quantile
- Parameters:
result (NDResult) – The NDResult object for which to calculate statistics.
- count(*, modes=None, times=None, positions=None, coordinates=None)[source]
Count the number of elements in the NDResult.
- Parameters:
modes (array-like or None, optional) – The modes to include in the count.
times (array-like or None, optional) – The times to include in the count.
positions (array-like or None, optional) – The positions to include in the count.
coordinates (array-like or None, optional) – The coordinates to include in the count.
- Returns:
The number of elements in the filtered NDResult.
- Return type:
int
- mean(*, modes=None, times=None, positions=None, coordinates=None)[source]
Calculate the mean value of the NDResult.
- Parameters:
modes (array-like or None, optional) – The modes to include in the mean calculation.
times (array-like or None, optional) – The times to include in the mean calculation.
positions (array-like or None, optional) – The positions to include in the mean calculation.
coordinates (array-like or None, optional) – The coordinates to include in the mean calculation.
- Returns:
The mean value of the filtered NDResult.
- Return type:
float
- std(*, modes=None, times=None, positions=None, coordinates=None)[source]
Calculate the standard deviation of the NDResult.
- Parameters:
modes (array-like or None, optional) – The modes to include in the standard deviation calculation.
times (array-like or None, optional) – The times to include in the standard deviation calculation.
positions (array-like or None, optional) – The positions to include in the standard deviation calculation.
coordinates (array-like or None, optional) – The coordinates to include in the standard deviation calculation.
- Returns:
The standard deviation of the filtered NDResult.
- Return type:
float
- min(*, modes=None, times=None, positions=None, coordinates=None)[source]
Calculate the minimum value of the NDResult.
- Parameters:
modes (array-like or None, optional) – The modes to include in the minimum value calculation.
times (array-like or None, optional) – The times to include in the minimum value calculation.
positions (array-like or None, optional) – The positions to include in the minimum value calculation.
coordinates (array-like or None, optional) – The coordinates to include in the minimum value calculation.
- Returns:
The minimum value of the filtered NDResult.
- Return type:
float
- dimmin(*, modes=None, times=None, positions=None, coordinates=None)[source]
Calculate the minimum value and corresponding dimensions of the NDResult.
- Parameters:
modes (array-like or None, optional) – The modes to include in the minimum value calculation.
times (array-like or None, optional) – The times to include in the minimum value calculation.
positions (array-like or None, optional) – The positions to include in the minimum value calculation.
coordinates (array-like or None, optional) – The coordinates to include in the minimum value calculation.
- Returns:
A series containing the minimum value and corresponding dimensions of the filtered NDResult.
- Return type:
pandas.Series
- max(*, modes=None, times=None, positions=None, coordinates=None)[source]
Calculate the maximum value of the NDResult.
- Parameters:
modes (array-like or None, optional) – The modes to include in the maximum value calculation.
times (array-like or None, optional) – The times to include in the maximum value calculation.
positions (array-like or None, optional) – The positions to include in the maximum value calculation.
coordinates (array-like or None, optional) – The coordinates to include in the maximum value calculation.
- Returns:
The maximum value of the filtered NDResult.
- Return type:
float
- dimmax(*, modes=None, times=None, positions=None, coordinates=None)[source]
Calculate the maximum value and corresponding dimensions of the NDResult.
- Parameters:
modes (array-like or None, optional) – The modes to include in the maximum value calculation.
times (array-like or None, optional) – The times to include in the maximum value calculation.
positions (array-like or None, optional) – The positions to include in the maximum value calculation.
coordinates (array-like or None, optional) – The coordinates to include in the maximum value calculation.
- Returns:
A series containing the maximum value and corresponding dimensions of the filtered NDResult.
- Return type:
pandas.Series
- quantile(q=0.25, *, modes=None, times=None, positions=None, coordinates=None, **kwargs)[source]
Calculate the quantile value(s) of the NDResult.
- Parameters:
q (float or array-like, optional) – The quantile(s) to calculate. Default is 0.25.
modes (array-like or None, optional) – The modes to include in the quantile calculation.
times (array-like or None, optional) – The times to include in the quantile calculation.
positions (array-like or None, optional) – The positions to include in the quantile calculation.
coordinates (array-like or None, optional) – The coordinates to include in the quantile calculation.
**kwargs – Additional keyword arguments to pass to xarray.DataArray.quantile().
- Returns:
The calculated quantile value(s) of the filtered NDResult.
- Return type:
numpy.ndarray
- describe(percentiles=None)[source]
Generate descriptive statistics of the NDResult.
- Parameters:
percentiles (array-like or None, optional) – The percentiles to include in the descriptive statistics. Default is [0.25, 0.5, 0.75].
- Returns:
A DataFrame containing descriptive statistics of the NDResult.
- Return type:
pandas.DataFrame