I’m working on a personal project for property data. I am trying to classify a value (floor height) based on a grouped variable (by town).
I have a function here , but its not quite working. Can someone suggest another way to do this?
> def classify_floor(x): if x> combined2['high_floor_cap']: return "high" elif x< combined2['low_floor_cap']: return "low" else: return "mid" test_class = combined['storey_start'].apply(classify_floor) test_class.head() ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().