Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

find percentage of missing values in a column in python

features_with_na=[features for features in dataset.columns if dataset[features].isnull().sum()>0]
for feature in features_with_na:
  print(feature, np.round(dataset[feature].isnull().mean(),4), ' %missing values')
Comment

Number of missing values per column

country                   14
year                       0
uniqueid                   0
Has a Bank account        36
Type of Location          15
Cell Phone Access         11
household_size            28
Respondent Age            34
gender_of_respondent      34
The relathip with head     4
marital_status            32
Level of Educuation       29
Type of Job               30
dtype: int64
Comment

PREVIOUS NEXT
Code Example
Python :: create requirement .txt 
Python :: python http request params 
Python :: How to wait a page is loaded in Python Selenium 
Python :: python spammer 
Python :: numpy array with 2 times each value 
Python :: python hide print output 
Python :: finding factorial of a number in python 
Python :: python filter dictionary by keys 
Python :: how to loop over list 
Python :: pyqt5 button connect 
Python :: poetry python download windows 
Python :: groupby and sort python 
Python :: how to remove duplicates from a python list 
Python :: check type of django messages 
Python :: dummy variables pandas 
Python :: python array extend 
Python :: how to get the value out of a dictionary python3 
Python :: python open file for reading and writing 
Python :: df size 
Python :: real hour in python 
Python :: shape pandas 
Python :: How to join two dataframes by 2 columns so they have only the common rows? 
Python :: embed image in html from python 
Python :: python3 shebang line 
Python :: number of days in a month python 
Python :: picasa 
Python :: can is slice list with list of indices python 
Python :: merge dicts python 
Python :: word2number python 
Python :: pydrive upload file to folder 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =