I'm looking for a function that would do what the function `indices`

does in the following hypothetical code:

```
indices( numpy.array([[1, 2, 3], [2, 3, 4]]) )
```

{1: [(0,0)], 2: [(0,1),(1,0)], 3: [(0,2),(1,1)], 4: [(1,2)]}

Specifically, I want to produce a dictionary whose keys are the unique elements in the flattened array and whose values are lists of the full indices of the respective key.

I've looked at the `where`

function, but it does not seem to provide an efficient way to solve this for large arrays. What's the best way to do this?

Notes: I'm using Python 2.7