Completion requirements
Here is an example that combines much of what has been introduced within the course using a very practical application. You should view this step as a culminating project for the first six units of this course. You should master the material in this project before moving on to the units on data mining.
Histograms
You can use Seaborn's .histplot()
method to create a histogram,
which provides frequency counts for continuous data. This method uses
the argument bins=
to specify the number of bins in the histogram.
Note: In the plot below, the y-axis represents the count of values falling within each bin.
# view of states with lower population df_small = df.loc[df.loc[:, 'Population_Mil'] < 20] # create histogram sns.histplot(x = 'Population_Mil', data = df_small, bins = 15) plt.show()
Two overlapping distributions to compare frequencies.
# create overlapping histogram with two calls sns.histplot(x = 'Rates.Property.Motor', data = df_small, bins = 15) sns.histplot(x = 'Rates.Property.Burglary', data = df_small, bins = 15, color = 'purple') plt.show()