반응형
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
- Google Excel
- PostgreSQL
- array
- Tkinter
- Apache
- Python
- Excel
- Kotlin
- 파이썬
- django
- Github
- gas
- math
- matplotlib
- dataframe
- string
- SQL
- hive
- Redshift
- GIT
- google apps script
- PySpark
- numpy
- list
- Mac
- c#
- Google Spreadsheet
- Java
- PANDAS
Archives
- Today
- Total
목록Multi index (1)
달나라 노트
Python Pandas : Multi index 없애기, 다중 column 없애기, multi column 없애기
Pandas를 통해서 데이터를 다루다 보면 간혹 multi index가 생기는 경우가 있습니다. 특히 pivot_table() method를 사용한 후에 자주 발생하는데 이런 경우는 사실 다루기가 마냥 좋은 상태는 아닙니다. import pandas as pd multi_cols = pd.MultiIndex.from_tuples( [ ('number', 'date'), ('number', 'item'), ('string', 'item_name') ] ) df_test = pd.DataFrame( [ (20230101, 1, 'a'), (20230101, 2, 'b'), (20230101, 3, 'c'), (20230102, 1, 'a'), (20230102, 3, 'c'), (20230103, 2, 'b..
Python/Python Pandas
2023. 10. 24. 23:53