Useful to replace text with boolean value for A.I. code
# Replaces Male -> 0 df['sex'] = df['sex'].replace('Male', 0) # Replaces Female -> 1 df['sex'] = df['sex'].replace('Female', 1)