[pandas] Cut rows based on integer
To cut rows based on integer and convert its type into category, there are two method : pd.cut() : Set boundary while we cut rows based on integer pd.qcut() : Set automatic boundary while we cut rows based on integer. After using this method, final datatype of columns become Categorical class. bins = [1, 20, 30, 50, 70, 100] labels = ["미성년자", "청년", "중년", "장년", "노년"] titanic['age_cat'] = pd.cut(t..