Hi,
my question is how I can find the centroid of group of cells that share the same value. Say I have this:
grid = [[0, 0, 0, 0, 0],
[0, 1, 1, 1, 0],
[0, 1, 1, 0, 0],
[0, 1, 1, 1, 0],
[0, 0, 0 ,0, 0]]
I need to get the centroid in x and y = (1.875, 2)
I tried to iterate over all values and when this is 1 store all the x and y coordinates but im stucked as how to actually get the centroid of these points.