Simple question, I want to get a 1D numpy array.
Given a 2D array where each row contains a single '1' value, how can it be converted to a 1D array, consisting of the column index of the '1' in the 2D array
[[ 0. 0. 1.]
[ 0. 0. 1.]
[ 0. 0. 1.]
[ 0. 1. 0.]
[ 0. 1. 0.]
[ 0. 1. 0.]
[ 0. 1. 0.]
[ 1. 0. 0.]]
to
[2 2 1 1 1 1 0]
How would I do it in python? I don't know the terminology for it, do let me know the proper terms for such transformation.