Python Data Visualization Transcripts
Chapter: Streamlit
Lecture: Sidebar details

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Alright, let's go back to our code and now apply our filters will need to be a little more complex. Using all.
0:10 Now I use my year filter based on that range slider and then if someone chooses all in the make, I will create a dummy filter where it's always true.
0:23 Otherwise I'll use the same filter that we use in the past and then we create our data frame based on the make and year filter.
0:32 And I also want to show how if we choose to use our average fuel economy again and want to show that on the sidebar we can use ST.sidebar
0:43 and show that metric there. So let's see what the results look like. So now we have our average,
0:53 we show all makes here and we still have the ability to update. So now let's go back to our code and create our histogram using that data
1:13 and we'll also include our altair chart. So now we have our partly histogram the altair chart and now we want
1:25 to display both of those. We just do st.write instead of st.sidebar. So if we do write, it will write that on the main section of the page.
1:38 So I'll go ahead and do both our visualizations. Now if we save it, go back and rerun it, you now have an easier way to update our visualization.
1:54 So as we change our sliders and are able to view that at the same time we're viewing our visualizations and in a real time basis they are updating.
2:05 We can also update our makes to just show one or many of those and then our visualizations are quickly updated based on those selections.
2:16 And I hope this highlights for you how easy it is to incorporate,
2:20 streamlit into your visualizations and how much power you have for manipulating the data based on the users input.

Talk Python's Mastodon Michael Kennedy's Mastodon