Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to address a column in a 2d array python

>>> import numpy as np
>>> A = np.array([[1,2,3,4],[5,6,7,8]])

>>> A
array([[1, 2, 3, 4],
    [5, 6, 7, 8]])

>>> A[:,2] # returns the third columm
array([3, 7])
Comment

PREVIOUS NEXT
Code Example
Python :: how to add up a list in python 
Python :: play music with time in python 
Python :: plot distribution seaborn 
Python :: python enumerate start at 1 
Python :: how to count non null values in pandas 
Python :: download youtube-dl python 
Python :: plt axis label font size 
Python :: how to delete nan values in python 
Python :: python tkinter set minimum window size 
Python :: python get random character from string 
Python :: pandas replace values with only whitespace to null 
Python :: selenium webdriver 
Python :: split string by length python 
Python :: docs.python.org 
Python :: urlsplit python 
Python :: random hex color python 
Python :: chart-studio python install 
Python :: ffmpeg python cut video 
Python :: link python to python3 
Python :: plt.suptitle position 
Python :: python get day month year 
Python :: global keyword python 
Python :: mean of torch tensor 
Python :: Get a random joke in python 
Python :: ipython play sound 
Python :: convert from 12 hrs to 24 python 
Python :: pandas series to numpy array 
Python :: convert keys to values in python 
Python :: groupby year datetime pandas 
Python :: how to make images in python 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =