I'm using the titanic dataset and have a created a series Famsize. I'd like to create a second series that outputs 'single' if famsize =1, 'small' if 1 < famsize < 5 and 'large' if famsize >=5.
Famsize FamsizeDisc 1 single 2 small 5 large I've tried using np.where but as I have three outputs I haven't been able to find a solution.
Any suggestions?