Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Tags
- RFP
- 리눅스
- tibero
- Python 라이브러리
- it용어
- 파이썬 알고리즘
- 데이터베이스
- MariaDB
- 파이썬 데이터프레임
- csharp
- Python DataFrame
- Algorithm
- PYTHON
- Oracle
- VirtualBox
- python algorithm
- HTML
- it 용어
- 리눅스 명령어
- sql
- dbeaver
- 오라클
- 파이썬
- 알고리즘
- linux
- 코딩테스트
- 파이썬 전처리
- putty
- Oracle VM VirtualBox
- C#
Archives
- Today
- Total
오경석의 개발노트
Python_DataFrame Column 이름 변경, 삭제 본문
# 컬럼명 변경
df.rename(columns={'Before':'After', 'Before2':'After2', ...})
# 인덱스명 변경
df.rename(index={'Before':'After', 'Before2':'After2', ...})
# 다수의 컬럼명 변경(순서 변경x)
df.columns = ['After', 'After2', 'After3', ...]
# 컬럼 순서 변경(이름 변경x, 특정 컬럼 삭제 가능)
df[['Before', 'Before2', 'Before3', ...]]
# 특정 컬럼 삭제
del df['column_name']'프로그래밍 언어 > Python' 카테고리의 다른 글
| Python_DataFrame에서 특정 문자와 일치하는 행 추출 (0) | 2022.09.08 |
|---|---|
| Python_중심경향치(평균, 중간값, 최빈값) (0) | 2022.09.08 |
| Python_Numpy (0) | 2022.09.06 |
| Python_loc, iloc (0) | 2022.09.06 |
| Python_DataFrame (1) | 2022.09.06 |
Comments