Home > OS >  Dropna does not drop the row with NON value
Dropna does not drop the row with NON value

Time:12-03

I am using Dropno() to drop the row which includes non value and it not working:

here is my code:

    df = pd.DataFrame(data)
    df['Date_' str(coin)] = pd.to_datetime(df['Date_' str(coin)])
    df = df.dropna(how='any')           
    df.dropna(how='any', inplace=True)  

and here is the output of df.info()

Blockquote

enter image description here

CodePudding user response:

Non-null means there are values that are existing in those rows. I don't think I'm fully understanding the problem here.

CodePudding user response:

From the listing above it looks like all of your values are non-null. Are you sure the final DataFrame contains NaN and not the string representation?

Here is pandas documentation on missing data: https://pandas.pydata.org/pandas-docs/stable/user_guide/missing_data.html

  • Related