I am currently trying for a data series such as:
a = np.array([0,0,0,8,13,12,5,0,0,05,6,8,14,0,0,0])
To get the centroid of each number collective between the zeros as well as their position in the array. Here, the position is more important to me - I have yet to find a good approach to this.