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)