[Numpy-discussion] count_nonzero axis argument?

Warren Weckesser warren.weckesser at gmail.com
Mon Sep 17 09:24:22 EDT 2018


On Mon, Sep 17, 2018 at 7:38 AM Matthew Brett <matthew.brett at gmail.com>
wrote:

> Hi,
>
> Is there any reason that np.count_nonzero should not take an axis
> argument?  As in:
>
> >>> np.better_count_nonzero([[10, 11], [0, 3]], axis=1)
> array([2, 1])
>
>

It already does (since version 1.12.0):
https://docs.scipy.org/doc/numpy/reference/generated/numpy.count_nonzero.html

Warren


It would be much more useful if it did...
>
> Cheers,
>
> Matthew
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20180917/694b367c/attachment.html>


More information about the NumPy-Discussion mailing list