If I have the following matrix:
import numpy
ar = numpy.array((('0','1','2','3'), ('1','a','b','b'), ('2','b','c','d')), str)
print(ar)
Output:
[['0' '1' '2' '3']
['1' 'a' 'b' 'b']
['2' 'b' 'c' 'd']]
And I want to get the value where the condition for row and column is met. The header row are the columns (could be strings) and the first column on the left are all rows (could be strings). So if I have ‘2’ for column and ‘2’ for row I would get ‘c’. I don’t know ‘c’ yet only the values for rows and columns. How would I do that?
You can use
numpy.where:and: