I'm trying to extract the words in a 2d array so I need to do a row and column inspection so that I could get the characters.
Example: I have an array that contains a 2d dimensional which is shown in this photo Click here and this is the code that stores the array. I already resize it into 15x15
arr2 = np.array([my_list2])
arr2 = arr2.reshape(15,15)
The problem is every time I extracted the characters it won't give me the a for the apple.
E
A
G
L
E
P
P
L
E
This is the code that let me extract the strings:
board_size = 15
print(arr2)
for i in range(board_size):
for j in range(board_size):
val = arr2[i,j]
if val != '0' :
print(val)
` The output I need is to be able to display eagle and apple.
See Question&Answers more detail:os