Skip to content

Instantly share code, notes, and snippets.

@matmoody
Created April 22, 2016 17:22
Show Gist options
  • Save matmoody/f91a07e350eb7b4dc00e685f74420c93 to your computer and use it in GitHub Desktop.
Save matmoody/f91a07e350eb7b4dc00e685f74420c93 to your computer and use it in GitHub Desktop.
import pandas as pd
import scipy.stats as stats
import matplotlib.pyplot as plt
%matplotlib inline
loansData = pd.read_csv('https://github.com/Thinkful-Ed/curric-data-001-data-sets/raw/master/loans/loansData.csv')
loansData.head()
# Remove rows with null values
loansData.dropna(inplace=True)
# Create Box Plot on Amount.Requested
loansData.boxplot(column='Amount.Requested')
plt.show()
# Create Histogram on Amount.Requested
loansData.hist(column='Amount.Requested')
plt.show()
# Does data look normally distributed? Generate QQ plot to test answer
plt.figure()
graph = stats.probplot(loansData['Amount.Requested'], dist='norm', plot=plt)
plt.show()
# The amounts requested match the amounts funded by investors, which makes logical sense.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment