Notice
Recent Posts
Recent Comments
Link
250x250
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- S3
- 정책자금
- python
- 매입불공제
- lambda
- 외국납부세액공제
- Resolver
- 양도소득세
- command
- 금융소득
- boto3
- 세금계산서
- 농지연금
- 이자
- 성능개선
- 경매
- OpenSearch
- 인덱싱
- AWS
- 임업후계자
- kubectl
- route53
- 공매
- serverless
- 신탁공매
- 클러스터
- 산지연금
- 산지
- Kubernetes
- Filter
Archives
- Today
- Total
진지한 개발자
Convert GroupBy Series to DataFrame 본문
728x90
# Below are a quick example
# Example 1: Convert groupby Series
# Using groupby() & count() on multiple column
grouped_ser = df.groupby(['Courses', 'Duration'])['Fee'].count()
# Example 2: Convert groupby object to DataFrame
grouped_df = grouped_ser.reset_index()
# Example 3: Use the as_index attribute to get groupby DataFrame
grouped_df = df.groupby(['Courses', 'Duration'], as_index = False)['Fee'].count()
# Example 4: Use the to_frame method
grouped_df = grouped_ser.to_frame()
728x90
'IT > Python' 카테고리의 다른 글
unzip (0) | 2023.08.26 |
---|---|
S3 file 지우기 (0) | 2023.06.29 |
특정 이름의 S3 파일을 지우고 싶을 때 (0) | 2023.06.09 |
pip 설치 시 SSLError 오류 해결방법 (SSLCertVerificationError) (0) | 2023.05.22 |
Python 유용한 코드 (0) | 2023.05.20 |