I'm new to python so I need some help with this:

I have 2D array of numbers that represent density of a circle of material in a space and I want to locate the centre. So I want to get the index of the numbers representing the diameter and then the middle index will be the centre. In this code I only store the value of the density : tempdiameter.append(cell) I want the index of the cell itself. How can I do that. Also I don't want to use lists for diameter. so how can I create a dynamic 1D np array? Thanks

```
for row in x:
for cell in row:
if cell!=0:
tempdensity+=cell
tempdiameter.append(cell)
if tempdensity>maxdensity:
maxdensity=tempdensity
if len(tempdiameter)>=len(diameter):
diameter=tempdiameter
tempdensity=0
tempdiameter=[]
```