replace null with 0 in dataframe code example Example: pandas replace nulls with zeros df['col1'] = df['col1'].fillna(0)