Spot the odd one out:
np.array defaults to copy=True, subok=False
np.ma.array defaults to copy=False, subok=True
np.asarray defaults to copy=False, subok=False
np.ma.asarray defaults to copy=False, subok=False
np.asanyarray defaults to copy=False, subok=True
np.ma.asanyarray defaults to copy=False, subok=True
So as a result, np.ma.asanyarray and np.ma.array are exactly the same.
More confusingly, np.ma.asarray is stricter than np.ma.array, not less strict!
I don't know if there's any way we can fix this without breaking downstream code, but it seems like a poor design decision - and violates the expectation that np.ma.func and np.func are similar.
Spot the odd one out:
np.arraydefaults tocopy=True, subok=Falsenp.ma.arraydefaults tocopy=False, subok=Truenp.asarraydefaults tocopy=False, subok=Falsenp.ma.asarraydefaults tocopy=False, subok=Falsenp.asanyarraydefaults tocopy=False, subok=Truenp.ma.asanyarraydefaults tocopy=False, subok=TrueSo as a result,
np.ma.asanyarrayandnp.ma.arrayare exactly the same.More confusingly,
np.ma.asarrayis stricter thannp.ma.array, not less strict!I don't know if there's any way we can fix this without breaking downstream code, but it seems like a poor design decision - and violates the expectation that
np.ma.funcandnp.funcare similar.