I have 2 columns in my data frame. “adult” represents the number of adults in a hotel room and “children” represents the number of children in a room.
I want to create a new column based on these two.
For example if df['adults'] == 2 and df[‘children’]==0
the value of the new column would be "couple with no children".
And if the df['adults'] = 2 and df[‘children’]=1
the value of the new column would be "couple with 1 child".
I have a big amount of data and I want the code to run fast.
Any advice? This is a sample of the inputs and the output that I need.
adult children family_status
2 0 "Couple without children"
2 0 "Couple without children"
2 1 "Couple with one child"