[Numpy-discussion] ENH: add a 'return_counts=' keyword argument to `np.unique`

Jaime Fernández del Río jaime.frio at gmail.com
Thu Jan 9 13:32:29 EST 2014


Hi,

I have just sent a PR, adding a `return_counts` keyword argument to
`np.unique` that does exactly what the name suggests: counting the number
of times each unique time comes up in the array. It reuses the `flag` array
that is constructed whenever any optional index is requested, extracts the
indices of the `True`s in it, and returns their diff. You can check it here:

https://github.com/numpy/numpy/pull/4180

Regards,

Jaime

-- 
(\__/)
( O.o)
( > <) Este es Conejo. Copia a Conejo en tu firma y ayúdale en sus planes
de dominación mundial.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20140109/bd688b54/attachment.html>


More information about the NumPy-Discussion mailing list