Home > Enterprise >  Nan columns not dropping
Nan columns not dropping

Time:08-02

i have the data-set that contains some NAN values i tried this to drop it but its still showing

df['string_tweet'].dropna(inplace=True)
df['string_tweet']

this is the output

113                        apc started let ’ finish started
235       upon vote katsina , apc government left state ...
1796      two people contesting office , one person win ...
1798      deji said peter obi jumping church church.na d...
1850      amnesia set , lem say deleting incriminating p...
                                ...                        
378726                                                  nan
378727                                                  nan
378728                                                  nan
378729                                                  nan
378730                                                  nan
Name: string_tweet, Length: 63664, dtype: object

CodePudding user response:

Use the subset argument to work on the whole dataframe:

df.dropna(subset=['string_tweet'], inplace=True)

CodePudding user response:

I guess, that the pictured nan are of type numpy.ndarray try to convert your column before droping the NaN.

df['string_tweet']=df['string_tweet'].astype(float)
  • Related