# single column
df['column_name'].apply(pd.to_numeric).astype('Int64')
# range of cols
df.loc[:, 'col_n':'col_m'] = df.loc[:, 'col_n':'col_m'].apply(pd.to_numeric).astype('Int64')
'''
From Pandas v0.24, introduces Nullable Integer Data Types
which allows integers to coexist with NaNs.
'''
df = df.astype("object").where(pd.notnull(df), None)
df1 = df.where(pd.notnull(df), None)
df. replace(np. nan,'',regex=True)