pandas apply function to column if element is nan code example Example: pandas nan values in column df['your column name'].isnull()