running_meanο
- plasmapy.analysis.time_series.running_moments.running_mean(signal, radius: int)[source]ο
Calculate the running mean of a sequence.
- Parameters:
signal (1D array_like) β Signal to be averaged.
radius (int) β The number of points on either side of each point for which the running mean is being calculated. The window size is
2 * radius + 1.
- Returns:
Running mean of
signalwith lengthlen(signal) - 2 * radius.- Return type:
1D array_like
- Raises:
ValueError β If
len(signal) <= 2 * radius.
Examples
>>> from plasmapy.analysis.time_series.running_moments import running_mean >>> running_mean([1, 2, 3, 4], 1) array([2., 3.])