
Problem –
You have a column which contains True and False Boolean values and you want to convert them to 1s or 0s in pandas.
Solution –
To map True and False to 1s and 0s in pandas use the replace method.
df.replace({False: 0, True: 1}, inplace=True)