text_html_output_1.png text_plain_output_1.png
import numpy as np

import pandas as pd

import seaborn as sns

filepath = '../input/should-this-loan-be-approved-or-denied/'
savepath = './'

sba = pd.read_csv(filepath + 'SBAnational.csv', low_memory=False)

def fixvals(val):
    retval = val.replace('$', '')
    retval = retval.replace(',', '')
    return retval
sba = pd.read_csv(filepath + 'SBAnational.csv', converters={'DisbursementGross': fixvals, 'SBA_Appv': fixvals, 'GrAppv': fixvals, 'ChgOffPrinGr': fixvals}, parse_dates=['DisbursementDate'], low_memory=False)

sba = sba.astype({'DisbursementGross': np.float64, 'SBA_Appv': np.float64, 'GrAppv': np.float64, 'ChgOffPrinGr': np.float64, 'NAICS': np.str_})

def check_cols_with_nulls(df):
    cols_with_missing = [col for col in df.columns if df[col].isnull().any()]
    if len(cols_with_missing) == 0:
        print('No Missing Values')
    else:
        print(cols_with_missing)
    sns.heatmap(df.isnull(), yticklabels=False, cbar=False, cmap='viridis')
check_cols_with_nulls(sba)