no data exclution and unique combination.

Ian Kelly ian.g.kelly at
Tue Jul 24 21:28:01 CEST 2012

On Jul 24, 2012 12:32 PM, <giuseppe.amatulli at> wrote:

> after i need to calculate unique combination in pairs to count the
> 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:

If you really want triples instead of pair-value pairs, then you would need
to flatten the tuples yourself.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list