moving_average
Luo_Suppe2026-08-15
gma.math.smooth.moving_average
function moving_average(data, window_size = 5, times = 1, edge_mode = "interp", axis = 0):
Data smoothing based on moving average method.
Parameters:
data: array.
Data that needs smoothing.
Optional:
window_size = int. Default 5.
Smoothing window size. Must be a positive odd number.
times = int. Default 1.
Smoothing times.
edge_mode = str. Default 'interp'.
Edge data processing methods. Supported methods include: 'nearest', 'mirror', 'interp', 'wrap'.
axis = int. Default 0.
The axis to use for data smoothing.
Returns:
Type: array.