pandas replace nan with 0 for some columns code example Example: python pandas convert nan to 0 pandas.DataFrame.fillna(0)