i have a dataframe of 400 x 25. i am supposed to remove ALL Nans from the dataset and then select only 3 columns to work on from the 25 columns. I have done this using:
df1.dropna(axis=0)
df2=df1.loc[:,['bgr','wc','rc']]
df2['rc']=pd.to_numeric(df['rc'],errors='coerce')
df2['wc']=pd.to_numeric(df['wc'],errors='coerce')
rc and wc were showing up as objects when i did the dtypes, so i converted them to floats.
now, after i drop the Nans, i am left with only 252 rows. so i assumed that all the Nans had gone.
but when i did a df2.describe(), it showed 251 as count for 'rc' but 252 for 'bgr' and 'wc'. this was odd, so when i did a df2.rc.unique(), it showed up a Nan!!!!
my question: how do i remove this Nan??