[Numpy-discussion] np.histogram on arrays.

eat e.antero.tammi at gmail.com
Tue Mar 29 09:42:51 EDT 2011


Hi,

On Tue, Mar 29, 2011 at 4:29 PM, Éric Depagne <eric at depagne.org> wrote:

> Hi all.
>
> Sorry if this question has already been asked. I've searched the archive,
> but
> could not find anything related, so here is my question.
>
> I'm using np.histogram on a 4000x4000 array, each with 200 bins. I do that
> on
> both dimensions, meaning I compute 8000 histograms. It takes around 5
> seconds
> (which is of course quite fast).
>
> I was wondering why np.histogram does not accept an axis parameter so that
> it
> could work directly on the array without me having to write a loop.
>
> Or maybe did I miss some parameters using np.histogram.
>
FWIW, have you considered to use
http://docs.scipy.org/doc/numpy/reference/generated/numpy.histogramdd.html#numpy.histogramdd

Regards,
eat

>
> Thanks.
>
> Éric.
>
> Un clavier azerty en vaut deux
> ----------------------------------------------------------
> Éric Depagne                            eric at depagne.org
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20110329/9edba465/attachment.html>


More information about the NumPy-Discussion mailing list