Numpy can manipulate matrix. And matrix element can be got via numerical indexes.
Now, say I have a 3*3 square matrix M
(Actually, it is a Malcov transition matrix, where each element speaks the probability from one state switching to another).
And the row and column both represent rain, snow, niceday in order.
[0.5 ,0.25,0.25
1 , 0 , 0
0.25,0.25,0.5]
Ordinarily, if I want to get the (rain,snow) element, I would have to write M[0,1].
But I think this is not readable enough.
So I wonder if I can get such element M[‘rain’,’snow’], if I have defined such dict-like matrix before(if it is allowed numpy matrix manipulation rule)
You can set the variables
rain,snowandnicedayand use this variables instead the numbers