I have a matrix as shown:
X =
t r v
a 4 7 3
b 0 1 8
c 0 7 9
d 9 6 0
e 1 3 4
f 8 7 2
g 5 7 4
h 5 1 0
i 9 8 6
j 4 6 7
I have a dictionary with key value pair as follows:
Y = {'t': 5, 'r': 4, 'v': 2}
I am trying to map the values of Y with each column of the matrix X such that if the value in Y is greater than or equal to the value in X, we get '1' else we get '0'.
For ex: In the above code, the output should be:
Z = [011,001,011,110,001,111,111,100,111,011]
In this, for the first row, 't'=4 < 't'=5 in X; 'r'=7 > 'r'=4; 'v'=3 > 'v'=2 and so we get 011, and so on. I went through this and this but couldn't get a solution that I am looking for. TIA.