Answers for "select a column of numpy array"

0

select a column of numpy array

test = numpy.array([
  [1, 2], [3, 4], [5, 6]
])

>>> test[:,0]
array([1, 3, 5])

>>> test[:,[0]]
array([[1],
       [3],
       [5]])
Posted by: Guest on June-13-2021

Code answers related to "select a column of numpy array"

Python Answers by Framework

Browse Popular Code Answers by Language