Skip to content
Advertisement

python transform 1d array of probabilities to 2d array

I have an array of probabilities:

JavaScript

and I want to make it 2d array:

JavaScript

What is the best way to do so?

Advertisement

Answer

One idea is use numpy.hstack:

JavaScript

Or use numpy.c_:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement