replace(np.nan, 0) not working code example Example: pandas replace nan data["Gender"].fillna("No Gender", inplace = True)