본문 바로가기
카테고리 없음

pandas 시리즈 binning 방법 (pd.cut)

by judy@ 2023. 9. 7.

원하는 bin의 개수를 bins로, bin의 정보를 labels 로 전달하면 데이터가 레이블링 되어 나온다!

pd.cut(series, bins=3, labels=['bad', 'medium', 'good'])

(출처: https://pandas.pydata.org/docs/reference/api/pandas.cut.html)

반응형