I have tried to use double indexing but this has not worked for me.
P.S check my work below
As you can see my code is not replacing only the digit at x,y position but every position at x.
Example variables for solution
field =[[0, 1, 1],[1, 0, 1],[0, 0, 1]]
x_axis = 1
y_axis = 1
Input
def solution(field, x, y):
arr = [[-1] * len(field)]*len(field)
print(arr)
total_mines = 0
for array in field:
temp_mines = array[x-1] + array[x] + array[x+1]
total_mines += temp_mines
arr[y][x]) = int(total_mines)
print(arr)
Output
[[-1, -1, -1], [-1, -1, -1], [-1, -1, -1]]
[[-1, 5, -1], [-1, 5, -1], [-1, 5, -1]]