заменить Нэн в пандах
df['DataFrame Column'] = df['DataFrame Column'].fillna(0)
Dark Duck
df['DataFrame Column'] = df['DataFrame Column'].fillna(0)
import pandas as pd
import numpy as np
df = pd.DataFrame({'col1':['one', 'two', 'three', 'four']})
df['col1'] = df['col1'].map(lambda x: np.nan if x in ['two', 'four'] else x)