Answers for "numpy get column from array"

1

extract column numpy array python

# Extract/ Slice only the 3rd column from the numpy array
print(a2[:,[2]])
Posted by: Guest on October-16-2020
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
0

access to specific column array numpy

second_and_third_column = an_array[:, 1:3]
Posted by: Guest on December-29-2020

Code answers related to "numpy get column from array"

Python Answers by Framework

Browse Popular Code Answers by Language