Question: I have a multi-dimensional list as like below

```
multilist = [[1,2],[3,4,5],[3,4,5],[5,6],[5,6],[5,6]]

```

How can I get below results fast:

```
[1,2]: count 1 times
[3,4,5]: count 2 times
[5,6]: count 3 times

```

and also get the unique multi-dimensional list (remove duplicates) :

```
multi_list = [[1,2],[3,4,5],[5,6]]

```

Thanks a lot.

Answer: 
How about using repr( alist) to convert it to its text string representation?

```
from collections import defaultdict

d = defaultdict(int)
for e in multilist: d[ repr(e)] += 1

for k,v in d.items(): print "{0}: count {1} times".format( k,v)

```
You can use a dictionary for this

```
count_data = {}

for my_list in multilist:
    count_data.setdefault(tuple(my_list), 0)
    count_data[tuple(my_list)] += 1

```