Reputation: 966
I'm needing to combine the rows in this array:
array([[0. , 1. , 0.44768612],
[0.34177215, 1. , 0. ]])
So that the output is:
array([[0., 0.34177215], [1., 1.], [0.44768612, 0.])
But for some reason, I can't figure it out with the reshape function. Any help would be appreciated.
Upvotes: 0
Views: 60
Reputation: 3843
If x
is your array, x.T
will transpose it:
array([[0. , 1. , 0.44768612],
[0.34177215, 1. , 0. ]])
becomes
array([[0. , 0.34177215],
[1. , 1. ],
[0.44768612, 0. ]])
Upvotes: 2