[Numpy-discussion] Fancier indexing

Kevin Jacobs <jacobs@bioinformed.com> bioinformed@gmail....
Thu May 22 11:13:55 CDT 2008

On Thu, May 22, 2008 at 12:08 PM, Keith Goodman <kwgoodman@gmail.com> wrote:

> How big is n? If it is much smaller than a million then loop over that
> instead.

n is always relatively small, but I'd rather not do:

for i in range(n):
  counts[i] = (items==i).sum()

If that was the best alternative, I'd just bite the bullet and code this in

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080522/aff599bc/attachment.html 

More information about the Numpy-discussion mailing list