Box Plots Workout
- 01:17
How to use Seaborn and box plot functions to analyze and visualize stock data by sector.
Downloads
No associated resources to download.
Glossary
box plot Machine Learning Python SeabornTranscript
Display the stock data box distribution of the beta feature by sector, as well as the return feature by sector.
I'm gonna point towards seaborn and then the box plot function, and then I'm gonna tell the box plot function, in the first argument, I want to classify my data by sector, so I'm splitting my data into the different classes inside my sector feature. And after doing that, I want to analyze the beta feature, which is a numerical feature. Then I'm telling it in this third argument that my data is coming from the stock data data set, and I forgot to do this, but I'm adding my pyplot show function so that this displays cleanly. Here you can see that I've split my data into the different sectors, which are on my Y axis. And then on the X axis I have this numerical beta value, so I can see how each of these sectors differs in their beta. Now I can do the same thing by showing the box plot, splitting my data by sector again, but now analyzing our return numerical feature, still using the stock data dataframe, and here I can look at the various returns across sectors.