Legacy – Histograms Workout
- 01:56
Workout demonstrating how to create Histograms in Python.
Downloads
Histogram - Python Workout FilesGlossary
Histogram MatplotlibTranscript
We will want to create a histogram for the data. To do that first import the pandas because we should be using the same data set now, the data equals to . read underscore. And then again, it's the same procedure like we did for the boxplot, we need to select the data and the day the column in this case and we say plot kind equals hist. And we can have different histogram types, but in this case, we should be selecting the hist type to be stepped in the bins to be 30 and standard procedure PLT dot show, and we run this perfect, the hist type and the bins can be different options, we can select this based on the kind of data we're dealing with more information on this can be found on the Python documentation. We may want to plot multiple histograms. In that case, we just have to make one change. We say hist here and we just remove this one because we are automatically defining the histogram and we select this and we add another one for safety 25. And we run this, exactly looks like this. Python automatically assigns a colour for the different histograms. Perfect