Pandas 데이터프레임 인덱스로 컬럼 제거

Jmnote (토론 | 기여)님의 2021년 3월 14일 (일) 16:06 판 (새 문서: ==개요== ;Pandas 데이터프레임 인덱스로 컬럼 제거 * 인덱스는 0부터 시작한다. <syntaxhighlight lang='python' run> import pandas as pd df = pd.read_csv("https:/...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요

Pandas 데이터프레임 인덱스로 컬럼 제거
  • 인덱스는 0부터 시작한다.
import pandas as pd
df = pd.read_csv("https://raw.githubusercontent.com/mwaskom/seaborn-data/master/iris.csv")
print( df.head() )
import pandas as pd
df = pd.read_csv("https://raw.githubusercontent.com/mwaskom/seaborn-data/master/iris.csv")
df.drop(df.columns[1], 1, inplace=True)
df.drop(df.columns[2], 1, inplace=True)
print( df.head() )

2 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}