I have a data frame with an 'education' attribute. Values are discrete, 1-16. For purposes of cross-tabulation, I want to bin this 'education' variable but with custom bins (1:8, 9:11, 12, 13:15, 16).
I've been fooling around with pd.cut() but I get an invalid syntax error
adult_df_educrace['education_bins'] = pd.cut(x=adult_df_educrace['education'], bins=[1:8, 9, 10:11, 12, 13:15, 16], labels = ['Middle School or less', 'Some High School', 'High School Grad', 'Some College', 'College Grad'])