Created
December 15, 2018 00:22
-
-
Save AdroitAnandAI/94413596379e0840b1500575e3574c21 to your computer and use it in GitHub Desktop.
univ3
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
plt.figure(figsize=(25,25)) | |
for idx, col in enumerate(crimeData.columns[2:]): #excluding county & year | |
counts, bin_edges = np.histogram(crimeData[col], bins=10, density = True) | |
pdf = counts/(sum(counts)) | |
cdf = np.cumsum(pdf) | |
plt.subplot(7, 4, idx+1) | |
plt.plot(bin_edges[1:],pdf, label='PDF') | |
plt.plot(bin_edges[1:],cdf, label='CDF') | |
plt.title(col + " CDF",fontsize=15) | |
plt.xlabel(col) | |
plt.tight_layout() | |
plt.legend() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment