Is there a built-in method that would help me achieve the following efficiently: given an array, I need a list of arrays, each with indices to a different unique value of the array?

If `f` is the desired function,

```
b = f(a)

```

and 

```
u, idxs = unique(a)

```

then 

```
b[i] == where(idxs==i)[0]

```

I am aware that `pandas.Series.groupby()` can do this, but it may no be efficient to create a dict when there are over 10^5 unique integers.