특정 컬럼 조회 썸네일형 리스트형 파이썬 데이터프레임 - pandas 기초(3) 3. 데이터프레임 조회 # 라이브러리 불러오기 import pandas as pd import numpy as np import seaborn as sns # 타이타닉 데이터 불러오기 titanic = sns.load_dataset(('titanic')) titanic.head() 3.1 특정 컬럼 조회 df.loc[:, ['컬럼명1', '컬럼명2']] df[['컬럼명1', '컬럼명2']] ******** loc : 행과 열이름으로 데이터 조회 가능 # pclass 컬럼 불러오기 titanic.loc[:, 'pclass'] # titanic['pclass'] => 데이터 컬럼 pclass를 조회. 시리즈 형태로 출력(컬럼 하나만 출력할 경우, 시리즈 형태로 출력됨) # pclass 컬럼 불러오기 tita.. 더보기 이전 1 다음