Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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()
Add Comment
Please, Sign In to add comment