I've got the following array:
rxn_probability = [1. 0. 0.]
And I want to create another array, num_rxn, that has the same shape and size of rxn_probability, which contains a number of the reactions, so in this case num_rxn would be: [1, 2, 3]. Starting at 1 and increasing until it reaches the same size and shape of rxn_probability, so that if I change the size of rxn_probability the size and shape of num_rxn will automatically be changed.
So far I've tried:
num_rxn = np.array(range(len(rxn_probability + 1)))
(also tried using arange in a similar way)
But this outputs:
[0 1 2]
which isn't what I want because it doesn't start at 1 or end at 3.
I've been reading about numpy.empty_like but I'm not sure if that would be the best or right solution. Any ideas?
Cheers
rxn_probabilitywithout creating a new object?