I am trying to add a 'sex' column to an existing 'tips' dataframe. There are 244 rows that need to be filled randomly with either 'Male' or 'Female'. I have tried using a for loop to iterate through each row and assign either list option, but I can't quite get it right.
sex = ['Male', 'Female']
def sex():
for row in tips['sex']:
sex[random.randint(0,1)]
tips['sex'] = sex()