[Numpy-discussion] Adding an nd generalization of np.ma.mask_rowscols

Sebastian Berg sebastian at sipsolutions.net
Fri Jan 17 10:27:48 EST 2020

On Fri, 2020-01-17 at 10:39 +0000, Eric Wieser wrote:
> Today, numpy has a np.ma.mask_rowcols function, which stretches masks
> along
> the full length of an axis. For example, given the matrix::

> Questions for the mailing list then:

The additional question: I think I am good with adding a new name if we
cannot reasonably reuse the old ones.

> Can you think of a better name than mask_extend_axis?

Doubt it is good, but to put it there: extend_mask_along_axis

"along" shows up 2-3 times, although "along" really is the default for
most things in NumPy.

Tried thesaurus for "extend", the main other word seemed "spread" (but
it is very different from the current choice).

> Does my proposed meaning of axis make more sense to you than the one
> used by mask_rowcols?

It does to me (although I hardly ever use masked arrays). The `axis`
argument usually denotes the axis being operated on/along.

- Sebastian

> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20200117/15f3630f/attachment.sig>

More information about the NumPy-Discussion mailing list