average_chunks¶
-
average_chunks
(arr, wts, chunksize)[source]¶ Average the array arr with weights by chunks
Array len does not have to be multiple of chunksize
This version is optimised for plain numpy. It is roughly ten times faster that average_chunks_jit when used without numba jit. It cannot (yet) be used with numba because the add.reduceat is not support in numba 0.31
- Parameters
arr – 1D array of values
wts – 1D array of weights
chunksize – averaging size
- Returns
1D array of averaged data_models, 1d array of weights