I want to count the number of gaps in a numpy array. In this case the consecutive zeros count as one gap.
array = np.array([ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1692, 1692, 1692, 1692, 1692, 1692, 1692, 2458, 2458, 2458, 2458,
2458, 2458, 2458, 0, 0, 0, 3956, 3956, 3956, 3956, 3956,
3956, 3956, 0, 0, 0, 0, 5431, 5431, 5431, 5431, 5431,
5431, 5431, 0, 0, 0, 0, 0, 0, 0, 0, 0])
In the above array there are 4 gaps, so my output should be 4.