Guest User

Untitled

a guest
Dec 15th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. plt.figure(figsize=(25,25))
  2. for idx, col in enumerate(crimeData.columns[2:]): #excluding county & year
  3. counts, bin_edges = np.histogram(crimeData[col], bins=10, density = True)
  4. pdf = counts/(sum(counts))
  5. cdf = np.cumsum(pdf)
  6.  
  7. plt.subplot(7, 4, idx+1)
  8. plt.plot(bin_edges[1:],pdf, label='PDF')
  9. plt.plot(bin_edges[1:],cdf, label='CDF')
  10. plt.title(col + " CDF",fontsize=15)
  11. plt.xlabel(col)
  12. plt.tight_layout()
  13. plt.legend()
Add Comment
Please, Sign In to add comment