My code was working fine until I updated Numpy to 1.13.1. Now I get the following error

```
IndexError: boolean index did not match indexed array along dimension 0; dimension is 5 but corresponding boolean dimension is 4
```

… which is thrown at this line:

```
m = arr[np.diff(np.cumsum(arr) >= sum(arr) * i)]
```

I can’t seem to wrap my head around it. Any suggestions?

Here is my sample code:

```
a = [1,2,3,4,5]
l = [0.85,0.90]
s = sorted(a, reverse = False)
arr = np.array(s)
for i in l:
m = arr[np.diff(np.cumsum(arr) >= sum(arr) * i)]
```

## Kenil Vasani

`np.diff`

is one element smaller than data_array.numpy.diff

I am using Numpy 1.11, instead of an

`IndexError`

I get a`VisibleDeprecationWarning`

. So I guess using an incorrect size is no longer tolerated.You need to define which behaviour you want, e.g. start at the second element, or remove the last: