df.set_index('컬럼') : 기존에 있는 컬럼의 값을 인덱스로 만든다.
df.reset_index() : 인덱스를 원래대로 초기화 시킨다.
'Python > Pandas' 카테고리의 다른 글
[Python] Pandas DataFrame 데이터 확인하기 head(), tail(), shape, describe(), info() (0) | 2024.04.08 |
---|---|
[Python] Pandas DataFrame 유일한 값 찾기 unique(), nunique() (0) | 2024.04.08 |
[Python] Pandas DataFrame NaN 처리 isna(), notna(), dropna(), fillna(), ffill(), bfill() (0) | 2024.04.05 |
[Python] Pandas csv 파일 불러오기 pd.read_csv() (0) | 2024.04.05 |
[Python] Pandas DataFrame 가져오기 loc[], iloc[] (0) | 2024.04.05 |