Answers for "numpy change row to column"

1

how to change the values of a column in numpy array

>>> a = np.zeros((2,2), dtype=np.int)
>>> a[:, 0] =  1
>>> a
array([[1, 0],
       [1, 0]])
Posted by: Guest on July-05-2020
0

row to column python numpy

# row to column as well as vice versa
transformed_my_array = my_array.T
Posted by: Guest on November-26-2021

Python Answers by Framework

Browse Popular Code Answers by Language