Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to find empty rows of a dataset in python

import numpy as np                             # to use np.nan 
import pandas as pd                            # to use replace
    
df = df.replace(' ', np.nan)                   # to get rid of empty values
nan_values = df[df.isna().any(axis=1)]         # to get all rows with Na

nan_values                                     # view df with NaN rows only
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #empty #rows #dataset #python
ADD COMMENT
Topic
Name
9+2 =