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