본문 바로가기
IT

범위별 라벨링 pandas

by whathelllllllllllllllll 2022. 2. 24.
728x90

#범위별 레이블링. 

#레이블링을 함. 1-3세면 baby, 3-7세면 children .....
raw_data['age_cat'] = pd.cut(raw_data['Age'], 
                             bins=[037153060100], 
                             include_lowest=True
                             labels=['baby''children''teenage'
                                     'young''adult''old'])

댓글