Re: [Numpy-discussion] Rewrite np.histogram in c?

2015-03-23 Thread Nathaniel Smith
On Mar 23, 2015 6:59 AM, "Daniel da Silva" wrote: > > Hope this isn't too off-topic: but it would be very nice if np.histogram and np.histogram2d supported masked arrays. Is this out of scope for outside the numpy.ma package? Usually the way this kind of thing is handled is by adding an np.ma.his

Re: [Numpy-discussion] Rewrite np.histogram in c?

2015-03-23 Thread Eric Firing
On 2015/03/23 7:36 AM, Ralf Gommers wrote: > > > On Mon, Mar 23, 2015 at 2:59 PM, Daniel da Silva > mailto:var.mail.dan...@gmail.com>> wrote: > > Hope this isn't too off-topic: but it would be very nice if > np.histogram and np.histogram2d supported masked arrays. Is this out > of scope

Re: [Numpy-discussion] Rewrite np.histogram in c?

2015-03-23 Thread Ralf Gommers
On Mon, Mar 23, 2015 at 2:59 PM, Daniel da Silva wrote: > Hope this isn't too off-topic: but it would be very nice if np.histogram > and np.histogram2d supported masked arrays. Is this out of scope for > outside the numpy.ma package? > Right now it looks like there's no histogram function at all

Re: [Numpy-discussion] Rewrite np.histogram in c?

2015-03-23 Thread Daniel da Silva
Hope this isn't too off-topic: but it would be very nice if np.histogram and np.histogram2d supported masked arrays. Is this out of scope for outside the numpy.ma package? On Mon, Mar 16, 2015 at 2:35 PM, Robert McGibbon wrote: > Hi, > > It sounds like putting together a PR makes sense then. I'l

Re: [Numpy-discussion] Rewrite np.histogram in c?

2015-03-16 Thread Robert McGibbon
Hi, It sounds like putting together a PR makes sense then. I'll try hacking on this a bit. -Robert On Mar 16, 2015 11:20 AM, "Jaime Fernández del Río" wrote: > On Mon, Mar 16, 2015 at 9:28 AM, Jerome Kieffer > wrote: > >> On Mon, 16 Mar 2015 06:56:58 -0700 >> Jaime Fernández del Río wrote: >>

Re: [Numpy-discussion] Rewrite np.histogram in c?

2015-03-16 Thread Jaime Fernández del Río
On Mon, Mar 16, 2015 at 9:28 AM, Jerome Kieffer wrote: > On Mon, 16 Mar 2015 06:56:58 -0700 > Jaime Fernández del Río wrote: > > > Dispatching to a different method seems like a no brainer indeed. The > > question is whether we really need to do this in C. > > I need to do both unweighted & weig

Re: [Numpy-discussion] Rewrite np.histogram in c?

2015-03-16 Thread Jerome Kieffer
On Mon, 16 Mar 2015 06:56:58 -0700 Jaime Fernández del Río wrote: > Dispatching to a different method seems like a no brainer indeed. The > question is whether we really need to do this in C. I need to do both unweighted & weighted histograms and we got a factor 5 using (simple) cython: it is i

Re: [Numpy-discussion] Rewrite np.histogram in c?

2015-03-16 Thread Jaime Fernández del Río
On Sun, Mar 15, 2015 at 11:06 PM, Robert McGibbon wrote: > It might make sense to dispatch to difference c implements if the bins are > equally spaced (as created by using an integer for the np.histogram bins > argument), vs. non-equally-spaced bins. > Dispatching to a different method seems lik

Re: [Numpy-discussion] Rewrite np.histogram in c?

2015-03-15 Thread Robert McGibbon
My apologies for the typo: 'implements' -> 'implementations' -Robert On Sun, Mar 15, 2015 at 11:06 PM, Robert McGibbon wrote: > It might make sense to dispatch to difference c implements if the bins are > equally spaced (as created by using an integer for the np.histogram bins > argument), vs.

Re: [Numpy-discussion] Rewrite np.histogram in c?

2015-03-15 Thread Robert McGibbon
It might make sense to dispatch to difference c implements if the bins are equally spaced (as created by using an integer for the np.histogram bins argument), vs. non-equally-spaced bins. In that case, getting the bigger speedup may be easier, at least for one common use case. -Robert On Sun, Ma

Re: [Numpy-discussion] Rewrite np.histogram in c?

2015-03-15 Thread Jaime Fernández del Río
On Sun, Mar 15, 2015 at 9:32 PM, Robert McGibbon wrote: > Hi, > > Numpy.histogram is implemented in python, and is a little sluggish. This > has been discussed previously on the mailing list, [1, 2]. It came up in a > project that I maintain, where a new feature is bottlenecked by > numpy.histogr

[Numpy-discussion] Rewrite np.histogram in c?

2015-03-15 Thread Robert McGibbon
Hi, Numpy.histogram is implemented in python, and is a little sluggish. This has been discussed previously on the mailing list, [1, 2]. It came up in a project that I maintain, where a new feature is bottlenecked by numpy.histogram, and one developer suggested a faster implementation in cython [3]