Say I have the following numpy array:

```
a = np.arange(20)

```

And also an array containing indices as follows:

```
ix = np.array([4,10,15])

```

I've been trying to come up with a vectorized solution to the following question: How can I apply a function along `a` being splitted using the indices in `ix`?

So say I where to split `a` with `np.split` (I'm only using `np.split` here to illustrate the groups to which I would like to apply a function here):

```
np.split(a,ix)

[array([0, 1, 2, 3]),
 array([4, 5, 6, 7, 8, 9]),
 array([10, 11, 12, 13, 14]),
 array([15, 16, 17, 18, 19])]

```

And say for instance I'd like to take the sum on each chunk, so giving:

```
[6, 39, 60, 85]

```

How could I vectorize this using `numpy`?