From the course: Interactive Dashboards with Plotly and Dash
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Solution: Bar charts
From the course: Interactive Dashboards with Plotly and Dash
Solution: Bar charts
- [Instructor] All right, everybody, our Solution Code is up on the right. Let's go ahead and dive into our notebook. And so we have our ski resorts data read in. You may or may not have chosen to run the info method, but what I did was I went ahead and created a data frame called lift_type_by_country. Because we're going to be using this twice, it seems worth it to build a separate data frame as opposed to do our data manipulation within our bar function itself. So, we're going to group by country, we're going to keep this as a data frame column to make it easier to access, so, as index equals false. We're then going to use the ag method in sum all four of the columns that we're going to be interested in. And then finally, I chose to sort the values in descending order. And so we end up with our data frame that we get the sum of each lift type by country. And so to build our original bar chart, we just specify our data frame, our x column, our y column, and then throw in the title…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Intro to Plotly charts6m 2s
-
(Locked)
Demo: Plotly graph objects7m 38s
-
(Locked)
Demo: Plotly Express9m 30s
-
(Locked)
Basic Plotly charts2m 50s
-
(Locked)
Demo: Scatterplots and line charts6m 19s
-
(Locked)
Assignment: Line charts1m 51s
-
(Locked)
Solution: Line charts5m 2s
-
(Locked)
Plotting multiple series3m 50s
-
(Locked)
Demo: Bar charts5m 21s
-
(Locked)
Assignment: Bar charts2m 51s
-
(Locked)
Solution: Bar charts2m 20s
-
(Locked)
Pro tip: Bubble charts3m 1s
-
(Locked)
Pie and donut charts6m 23s
-
(Locked)
Assignment: Donut and bubble charts2m 6s
-
(Locked)
Solution: Donut and bubble charts5m 16s
-
(Locked)
Histograms4m 37s
-
(Locked)
Update methods5m 4s
-
(Locked)
Demo: Updating layout and traces7m 51s
-
(Locked)
Demo: Updating X and Y axes5m 47s
-
(Locked)
Adding annotations7m 54s
-
(Locked)
Assignment: Chart formatting1m 52s
-
(Locked)
Solution: Chart formatting3m 5s
-
(Locked)
Choropleth maps5m 32s
-
(Locked)
Demo: Choropleth maps7m 1s
-
(Locked)
Mapbox maps5m 23s
-
(Locked)
Demo: Density maps2m 4s
-
(Locked)
Assignment: Maps1m 43s
-
(Locked)
Solution: Maps1m 43s
-
(Locked)
Key takeaways2m 36s
-
(Locked)
-
-
-
-
-