user3682157
user3682157

Reputation: 1695

Remove Missing Data in Pandas (Python 3, Pandas)

This is frustrating me to no end --

I have a data frame called FINAL that looks like this

Match Type     Suffix     
0              NaN        
1              NaN        
2              NaN        
3              Exact                  
4              Exact   

I want to get rid of all the NAN data using this:

final.dropna() 

and this

final['Suffix'].dropna()

neither of them work! What am I missing!

Upvotes: 0

Views: 100

Answers (1)

Paul H
Paul H

Reputation: 68156

All of those operations return copies. You can either reassign the variable:

final = final.dropna() 

Or pass inplace=True:

final.dropna(inplace=True) 

Upvotes: 1

Related Questions