import pandas as pd import numpy as np df = pd.DataFrame({ 'key1': [4, 5, 3, np.nan, 2], 'key2': [1, 2, np.nan, 4, 5], 'key3': [1, 2, 3, 'j', 'k'] }, index=['a', 'b', 'c', 'd', 'e']) print(df) print(df['key1'].dtype,df['key2'].dtype,df['key3'].dtype)