Python Data Visualization Transcripts
Chapter: Streamlit
Lecture: Show charts

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Now that we have our widgets working, it's actually pretty simple to create the visualization. So let's expand our code window and let's say,
0:10 we want to add a histogram based on the selected data so now we can use our plot DF.
0:19 So that's the important part is plot DF has been filtered based on the user input and we'll create a figure for our histogram.
0:28 And just to show the versatility, I'm also gonna go back and use an altair chart. So let's say we want to use altair to do a tick plot for fuel type
0:38 summary. And now that we have both of those charts displaying them is really easy so we can just go in and use right ST.right to write out the figure.
0:51 So in this case the histogram and then also the altair chart. So once I save this we can go back to our example and click rerun.
1:05 And now we have our histogram and our strip plot. And just to show these are influenced by what we select here,
1:16 just like our average. So as those values are changed, it reflects in all the displays on the page. So down here we have our altair,
1:31 here's our histogram. Have full interactivity with plotly we have the options
1:36 with altair to save those images and then you'll also notice I have this option which
1:42 is sometimes useful when you have really complex plots that you can expand it so you
1:48 can zoom in if you need to and a lot of really cool options for you now. And then. The final thing I wanted to show is that you can
1:57 also display a data frame. So let's look at this again. So now we're gonna write some sample data and we'll just show the 1st 10 rows
2:10 of our plot data frame. So let's save that, it'll rerun everything and down at the bottom. Now we have that data frame, so if we want to inspect it,
2:23 it gives us a nice data frame view. It's a table where you can easily scroll and if you choose you can expand it
2:30 to see more of the information as well. So once again it streamlit makes it just very easy for you to take any kind
2:40 of data structure image, whatever you're working with and display it to your users and
2:47 allow them to interact with the data in a way that would be really difficult to
2:51 do just using a jupyter notebook or not having some kind of web server solution like we are doing with streamlit.


Talk Python's Mastodon Michael Kennedy's Mastodon