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: 
If you want to guarantee that the order of the unique items is the same as in the original list, you could do something like:

```
>>> class Seen(set):
...     def __contains__(self, item):
...         res = super(Seen, self).__contains__(item)
...         self.add(item)
...         return res
...
>>> seen = Seen()
>>> [item for item in multilist if tuple(item) not in seen]
[[1, 2], [3, 4, 5], [5, 6]]
>>>

```
---

You can try like this,

```
>>> multilist = [[1,2],[3,4,5],[3,4,5],[5,6],[5,6],[5,6]]
>>> c = [multilist.count(l) for l in multilist]
>>> for ind, l in enumerate(multilist):
...   print( "%s: count %d times" % (str(l), c[ind]))
... 
[1, 2]: count 1 times
[3, 4, 5]: count 2 times
[3, 4, 5]: count 2 times
[5, 6]: count 3 times
[5, 6]: count 3 times
[5, 6]: count 3 times

>>> {str(item): multilist.count(item) for item in multilist }
{'[1, 2]': 1, '[3, 4, 5]': 2, '[5, 6]': 3}

```