Last active
July 3, 2017 10:13
-
-
Save mzaradzki/ca1b2b34c7e6af9bcf459e6aa65fbfbb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find columns with Null values | |
nullcols = [] | |
for col in dfX.columns: | |
nbnull = (dfX[col].isnull()*1).sum() | |
if ( nbnull > 0 ): | |
tp = type(dfX[dfX[col].notnull()][col].iat[0]) # type of first non null value | |
nullcols.append([col, tp]) | |
print(col, nbnull, t) | |
# Output | |
# funder 3635 <type 'str'> | |
# installer 3655 <type 'str'> | |
# subvillage 371 <type 'str'> | |
# public_meeting 3334 <type 'bool'> | |
# scheme_management 3877 <type 'str'> | |
# scheme_name 28166 <type 'str'> | |
# permit 3056 <type 'bool'> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment