data science/pandas
index 처리
꼰대코더
2025. 3. 14. 11:00
CSV 읽어 들일때 index 지정
| df = pd.read_csv(‘xxx.csv’, index_col=’Country’) |
![]() |
![]() |
![]() |
| Id 를 index 로 변경 | 다시 되돌리기 | |
| df.set_index(‘Id’, inplace=True) | df.reset_index(inplace=True) |


