반응형
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
- list
- numpy
- math
- Redshift
- GIT
- google apps script
- PostgreSQL
- string
- Tkinter
- dataframe
- 파이썬
- hive
- PANDAS
- Github
- Google Spreadsheet
- Java
- array
- PySpark
- c#
- Kotlin
- gas
- Excel
- Google Excel
- Mac
- SQL
- Python
- matplotlib
- django
- Apache
Archives
- Today
- Total
목록Transform (1)
달나라 노트
Python Pandas : transform (유사 window function, 집계 결과를 index별로 추가하기)
transform method는 DataFrame에서 groupby로 집계한 결과를 동일한 index를 가진 행에 넣어서 return해줍니다. 말만 들으면 무슨 소린지 잘 감이 오지 않는데 실제 예시를 봅시다. import pandas as pd dict_item = { 'date': [ 20200101, 20200102, 20200103, 20200101, 20200102, 20200103, 20200101, 20200102, 20200103, 20200101, 20200102, 20200103, 20200104 ], 'item_id': [ 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4 ], 'item_name': [ 'a', 'a', 'a', 'b', 'b', 'b', 'c', ..
Python/Python Pandas
2023. 1. 31. 02:09