So I have this dataframe where category feature has both float and nan values. I want to convert all float values to integers. For that I tried
df['category'] = df['category'].apply(lambda x:int(x) if np.isnan(x)==False else x)
Unfortunately this code doesn't do anything. Why is that? And how can I modify this code for my own purpose?
Thank you