cut() ref
Simple cut
footprintBins = [0, 500, 750, 1000, 1500, 10000, 100000] df_building['footprintClass'] = pd.cut( df_building.footprintPerUnit, footprintBins)
Cut with custom labels; convert resulting category to string
storeyClassBins_aptHi = [4, 14, 24, 999] storeyClassBins_aptHi_labels = ['5To14Storey', '15To24Storey', '25AndUpStorey'] df_aptByP_Hi_bldgMatch['storeysClass'] = pd.cut( df_aptByP_Hi_bldgMatch.numStoreys_est, storeyClassBins_aptHi, labels=storeyClassBins_aptHi_labels) df_aptByP_Hi_bldgMatch['storeysClass'] = \ df_aptByP_Hi_bldgMatch['storeysClass'].astype(str)