On Jul 24, 2012 12:32 PM, <giuseppe.amatu...@gmail.com> wrote:

> after i need to calculate unique combination in pairs to count the
observations
> and obtain
> (4,3,2)
> (4,5,1)
> (5,4,1)
> (4,4,2)

I don't know about a numpy solution, but this could be achieved by
collections.Counter(zip(a, b)).items(). That gives you:
((4,3),2)
((4,5),1)
Etc.

If you really want triples instead of pair-value pairs, then you would need
to flatten the tuples yourself.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to