Behavior Changes
group_nanmeannow promotes boolean and integer input to float64. It previously computed the mean in the input's integer dtype, so a group of[4, 5]gave4rather than4.5(#553)- The moving functions now raise
ValueErrorfor amin_countgreater thanwindow, which no window can satisfy, instead of returning an all-NaN array (#817)
Bug Fixes
- Offset the covariance accumulators in
nancorrmatrixandnancovmatrix(#759) and in the four moving matrix functions (#767), and accumulate in float64. On input far from zero the old form lost the result to cancellation: with standard-normal columns shifted by1e8,move_covmatrixreturned variances of-15andmove_corrmatrixvalues of2.4.move_corrmatrixandmove_exp_nancorrmatrixnow also clip to[-1, 1], asnp.corrcoefdoes - Fix two label-dtype overflows in the grouped functions: widening a labels array no longer picks an unsigned dtype, which turned the
-1"no group" label into a large positive one, and thenum_labelsdefault no longer overflows on a label at the dtype's maximum (#749) - Accept a tuple
axisin themove_exp_*functions (#598)
Type Stubs
- Add stubs for
move_corrmatrix,move_covmatrix,move_exp_nancorrmatrixandmove_exp_nancovmatrix(#810) - Annotate the matrix function returns in
funcs.pyi(#812) - Widen the
nanquantileandnanmedianreturn types tonp.ndarray, since**kwargsreaches the gufunc and anout=ordtype=argument decides the result dtype (#815) - Accept a tuple
axisin the moving-function stubs (#783)
Internal
move_corrmatrixandmove_covmatrixmove out ofMOVE_FUNCSinto a newMOVE_MATRIX_FUNCSlist (#768)- Type checking moves from mypy to
ty, andstubtestnow checks the stubs against the runtime in CI (#472, #505, #748) - Various dependency updates
Full Changelog: v0.9.4...v0.9.5