Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

get columns that contain null values pandas

In [74]: df.columns[df.isna().any()].tolist()
Out[74]: ['a', 'b']
Comment

How many columns have null values present in them? in pandas

import pandas as pd
df = pd.DataFrame({'a':[1,2,np.nan], 'b':[np.nan,1,np.nan],'c':[np.nan,2,np.nan], 'd':[np.nan,np.nan,np.nan]})
print(pd.isnull(df).sum())
Comment

PREVIOUS NEXT
Code Example
Python :: pip fuzzywuzzy 
Python :: scatter plot of a dataframe in python 
Python :: python difference between consecutive element in list 
Python :: Python terminal colour 
Python :: count gabarit django 
Python :: urlsplit python 
Python :: python - show repeted values in a column 
Python :: how to convert multi list to dict 
Python :: percentage of null values for every variable in dataframe 
Python :: install python 3.9 centos8 
Python :: python open file relative to module 
Python :: pil python 
Python :: flask_mail 
Python :: post request python 
Python :: how to click on button using python 
Python :: python lexicographical comparison 
Python :: how to find no of times a elements in list python 
Python :: adjust size of plot 
Python :: print () 
Python :: how to make sun as first day in calendar python 
Python :: colab install library 
Python :: how to make a randomized pasword genirator in python 
Python :: swapping array location in python 
Python :: python new line command 
Python :: discord.py send messages 
Python :: how to uninstall python idle on ubuntu 
Python :: Draw Spiderman With Python And Turtle 
Python :: reverse python dict 
Python :: python more order of columns 
Python :: merge two df 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =