Answers for "non null rows from dataframe pandas"

2

show rows with a null value pandas

df1 = df[df.isna().any(axis=1)]
Posted by: Guest on March-19-2021
0

drop rows that contain null values in a pandas dataframe

df.dropna(inplace=True)
# to drop any rows that contain any null values
df.dropna(how='all', inplace=True)
# to drop the rows wich all of it's values is any

# if you want to drop the columns not the rows you just set the axis to 1 like this:
df.dropna(axis=1, inplace=True)
Posted by: Guest on December-09-2021

Code answers related to "non null rows from dataframe pandas"

Python Answers by Framework

Browse Popular Code Answers by Language