Legacy – Box Chart Workout
- 01:39
Workout demonstrating how to create a Box chart in Python.
Downloads
Box Chart - Python Workout FilesGlossary
Box Chart MatplotlibTranscript
We will now look at how to make a box chart in Python. So in order to do that we need to import two libraries, which is the pandas and matplotlib. The pandas because we will be using the data set and we will be importing the data set. So firstly import pandas as pd then import matplotlib . pyplot as plt now we need to import the data set the data would be the s&p 500 companies data we run this, perfect no errors returned. Now we know that the data consists of different days and for the different s&p companies it has the change in the stock values. So this is how the data is. So in order to plot a boxplot, we need to first select the data. Select the particular column which may be day 3 say and we say plot kind equals box and the box needs to be in quotation marks. Now we say plt . show. We see how this looks like. Perfect so this is how the boxplot is the values outside are the outliers. This is the median. This is the highest value, lowest value. The third quartile, the first quartile. That's it. That's how easy it is to make a boxplot in Python