text_html_output_1.png
import numpy as np

import pandas as pd

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_})

sba.to_csv(savepath + 'sba_save1.csv', index=False)

cols_to_drop = ['LoanNr_ChkDgt', 'Zip', 'Bank', 'BankState', 'ApprovalDate', 'ApprovalFY', 'ChgOffDate', 'BalanceGross']
sba.drop(columns=cols_to_drop, inplace=True)

x = sba[sba['DisbursementDate'].isna()]

sba.dropna(subset=['DisbursementDate'], how='all', inplace=True)
x = sba[sba['DisbursementDate'].isna()]
print(x.shape)