import pandas as pd
import numpy as np
df = pd.DataFrame(['ONE', 'Two', np.nan], columns=['x'])
xLower = df['x'].map(lambda x: x if type(x) != str else x.lower())
How to lowercase a python dataframe string column if it has missing values?