Answers for "drop na"

21

drop if nan in column pandas

df = df[df['EPS'].notna()]
Posted by: Guest on March-17-2020
2

remove rows or columns with NaN value

df.dropna()     #drop all rows that have any NaN values
df.dropna(how='all')
Posted by: Guest on August-23-2020
0

drop_na in pandas

# importing pandas module
import pandas as pd
  
# making data frame from csv file
data = pd.read_csv("nba.csv")
  
# making new data frame with dropped NA values
new_data = data.dropna(axis = 0, how ='any')
  
Posted by: Guest on June-06-2021
5

dropping nan in pandas dataframe

df.dropna(subset=['name', 'born'])
Posted by: Guest on April-27-2020
-1

dropna pandas

>>> df.dropna(axis='columns')
       name
0    Alfred
1    Batman
2  Catwoman
Posted by: Guest on April-02-2020
0

drop na

dropna
Posted by: Guest on February-05-2021

Browse Popular Code Answers by Language