pandas convert booleans to integer (1 or 0) First Published: Feb 19, 2022 Here's how to convert a series of booleans to 1 or 0 (integer) in Pandas. Listing 1: exampleimport pandas as pd df = pd.DataFrame({"val": [True, False]}) df["val"].astype(int) Result 0 1 1 0 Name: val, dtype: int64