You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
np.count_nonzero() should accept axis parameter #391
I wrote this elsewhere, but if no one else wants to try it, I can go on an "add axis" spree: I have working code for bincount (will try to make it into a PR tonight), and have searchsorted, interp, and now count_nonzero in the pipeline. Is there any other obvious one I am forgetting about?
an alternative might be to try and adapt sum(bool) to use the much faster non-casting count_nonzero code.
sum is already a full ufunc with all bells and whistles so one gets (extended) axis for free
Activity
charris commentedon Feb 17, 2014
Sounds reasonable.
jaimefrio commentedon Feb 17, 2014
I wrote this elsewhere, but if no one else wants to try it, I can go on an "add axis" spree: I have working code for bincount (will try to make it into a PR tonight), and have searchsorted, interp, and now count_nonzero in the pipeline. Is there any other obvious one I am forgetting about?
herr-biber commentedon Apr 23, 2014
Any news on this? I'd be interested in this feature as well.
juliantaylor commentedon Apr 23, 2014
an alternative might be to try and adapt sum(bool) to use the much faster non-casting count_nonzero code.
sum is already a full ufunc with all bells and whistles so one gets (extended) axis for free
seberg commentedon Apr 23, 2014
I am unsure if the ufunc reduce supports mixed type inner loops.
WarrenWeckesser commentedon Aug 6, 2014
+1 for adding an
axisargument tocount_nonzero().JaimieMurdock commentedon Nov 19, 2014
+1 here as well.
tentrillion commentedon Sep 3, 2015
Also +1 here.
lzkelley commentedon Oct 19, 2015
+1
Merge pull request numpy#391 from howjmay/vmaxv