Deprecate MaskedArray support for stats.gstd

Hi all,

Matt has been working on array API compatibility for the stats submodule. One function that is giving the team trouble is stats.gstd. The reason this function is difficult is that we support masked arrays leading to a much more complicated implementation than just a regular array. As far as I know, gstd is the only stats function to support masked arrays.

I would like to propose deprecating this behaviour in favour of only supporting standard arrays via the array API.

Matt has already created an implementation in a PR that is available on GitHub: MAINT: stats.gstd: return result rather than raising by mdhaber · Pull Request #20696 · scipy/scipy · GitHub

Does the mailing list agree that this is the correct decision?

Kind regards


1 Like

+1, this aligns with RFC: SciPy array types & libraries support · Issue #18286 · scipy/scipy · GitHub, which states that NumPy Masked arrays should only continue to be supported in stats.mstats.

Agreed. The design has always been that masked arrays are supported via stats.mstats, so this makes things more consistent.