Returning the indices of a value in a 2D array
I'm trying to create a system that returns the indices of a value in a 2D array, with values from A1 to J10. I can create the array: import numpy as np rows = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"] col = list(range(1, 11)) columns = [] for i in col: columns.append(str(i)) grid = [i + j for i in rows for j in columns] #creates a single list with every cell org = np.array(grid) #makes an array out of the list object 'grid' array = np.array_split(org, 10) #splits the array into 10 rows And I have no problem getting the value of a known index from the array ("D4" in this example) print(array[3][3]) But I can't do it the other way around, i.e. get the index of a known value. I've tried using index and where, and neither of them behave as I would expect: print(np.where(array == "D4")) print(array.index("D4")) What do I need to change to make either of them work?