Skip to content

Instantly share code, notes, and snippets.

@AdroitAnandAI
Created December 15, 2018 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdroitAnandAI/94413596379e0840b1500575e3574c21 to your computer and use it in GitHub Desktop.
Save AdroitAnandAI/94413596379e0840b1500575e3574c21 to your computer and use it in GitHub Desktop.
univ3
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