Last active
August 29, 2015 14:25
-
-
Save tomatau/8153c7cb1b410c34981a to your computer and use it in GitHub Desktop.
Thinkful Unit 2 Lesson 2.3
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
from scipy import stats | |
# import matplotlib.pyplot as plt | |
import pandas as pd | |
import collections | |
loansData = pd.read_csv( | |
'https://spark-public.s3.amazonaws.com/dataanalysis/loansData.csv' | |
) | |
loansData.dropna(inplace=True) | |
freq = collections.Counter(loansData['Open.CREDIT.Lines']) | |
# plt.figure() | |
# plt.bar(freq.keys(), freq.values(), width=1) | |
# plt.show() | |
chi, p = stats.chisquare(freq.values()) | |
print p, chi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment