In the following code , i am getting a syntax error near the ':' in the selected_rows and selected_patch I am not able to understand how to rectify it Can someone help me?
def selectNeighboringPatch(matrix, pos_row, pos_col, ex_len):
selected_rows = matrix([ range(pos_row - ex_len , pos_row + ex_len+1) , : ])
selected_patch = selected_rows([ : , range(pos_col - ex_len , pos_col + ex_len + 1)])
return selected_patch
selectNeighboringPatch( matrix = ([[1,1,1,1] ,[1,1,1,1] ,[1,1,1,1] ,[1,1,1,1]]) ,pos_row = 0 ,pos_col = 0 , ex_len = 2 )