Say you have a boolean/binary array in Numpy called 'a', where 'a' is a sequence of 0s and 1s (or equivalently True/False). I want to find the distances between the 1s in 'a'.
Eg. a = [1,**0,0**,1,**0**,1,**0,0,0,0,0**,1]
. Output = [2,1,5]
What is the most efficient way to evaluate this in Numpy Python? The actual dataset is of the order of 1,000,000 binary values.