# Data Visualization with Plotly and Seaborn: Explore the Gapminder Dataset with Plotly Express

Welcome to this project-based course on Exploring the Gapminder Dataset with Plotly Express. In this project, you will create quick and interactive data visualizations with Plotly Express: a high-level data visualization library in Python inspired by Seaborn and ggplot2. You will explore the various features of the in-built Gapminder dataset, and produce interactive, publication-quality graphs to augment analysis.

We will cover the following tasks in 42 minutes:

In this task, we will first demo Hans Rosling’s visualization of the Gapminder data set. The interactive, animated visualization was shown to the audience of Hans’ Ted talk in 2007. It has gone one to become one of the most watched Ted talks of all time, and is a testament to the power of beautiful and informative data visualizations.

We will then be introduced to the project goals and learning outcomes. Once we are familiarized with the Rhyme interface, we begin working in Jupyter Notebook, a web-based interactive computational environment for creating notebook documents.

### Quick Visualizations with Custom Bar Charts

Now that we have imported the data, we are free to use plotly express to explore various facets of this rich data set.

Plotly Express functions take as a first argument a tidy `pandas.DataFrame`. In this task, we will graph the population of Canada by year using a bar plot. In a bar plot, each row of the DataFrame is represented as a rectangular mark. We will also customize the bar plot using keyword arguments to color the bars according to the average life expectancy.

### Plot Life Expectancy vs GDP per Capita

We will create a basic scatter plot showing life expectancy vs GDP per captita by country for 2007.

Next, we will break that down by continent, by coloring the points using the `color` argument, while `px` takes care of assigning the default colors, setting up the legend, etc.

### Customize Interactive Bubble Charts

Each point in our last plot is a country. So to scale the points by the country population we simply pass in the `size` argument!

If we’re curious about the identity of a particular point, we can add a `hover_name` to display the country name. We will never again have to worry about what a particular outlier represents. We can simply mouse over the point we’re interested in and the `hover_name` will identify it for us!

### Create Interactive Animations and Facet Plots

We are able to easily interact with the plots we have created so far. Try mousing over points, clicking or double-clicking on legend items, or using the “modebar” that appears when you move your mouse into the frame to control the behaviour click-drag interactions (zoom, pan, select).

We can also facet our plots to pick apart the continents, just as easily as coloring your points, with `facet_col="continent"`, and let’s make the x-axis logarithmic to see things more clearly while we’re at it.

Maybe we’re interested in more than just 2007 want to see how this chart evolved over time. We can animate it by setting `animation_frame="year"` (and `animation_group="country"` to identify which circles match which ones across frames). We can provide prettier `labels` that get applied throughout the figure, in legends, axis titles and hovers. We can also provide some manual bounds so the animation looks nice throughout.

### Represent Geographic Data as Animated Maps

As this is geographic data, we can also represent it as an animated map, which makes it clear that px can make way more than just scatter plots, and that this dataset is missing data for the former Soviet Union.

## Watch Preview

Preview the instructions that you will follow along in a hands-on session in your browser.

## About the Host (Snehan Kekre)

Snehan hosts Machine Learning and Data Sciences projects at Rhyme. He is in his senior year of university at the Minerva Schools at KGI, studying Computer Science and Artificial Intelligence. When not applying computational and quantitative methods to identify the structures shaping the world around him, he can sometimes be seen trekking in the mountains of Nepal.

## Frequently Asked Questions

##### How is this different from YouTube, PluralSight, Udemy, etc.?
In Rhyme, all projects are completely hands-on. You don't just passively watch someone else. You use the software directly while following the host's (Snehan Kekre) instructions. Using the software is the only way to achieve mastery. With the "Live Guide" option, you can ask for help and get immediate response.
##### What do I need to install / configure to join this session?
Nothing! Just join through your web browser. Your host (Snehan Kekre) has already installed all required software and configured all data.
##### Is this session really free?
Absolutely! Your host (Snehan Kekre) has provided this session completely free of cost!
##### How do I create my own projects like this?
You can go to https://rhyme.com, sign up for free, and follow this visual guide How to use Rhyme to create your own projects. If you have custom needs or company-specific environment, please email us at help@rhyme.com
##### Can I buy Rhyme sessions for my company or learning institution?
Absolutely. We offer Rhyme for workgroups as well larger departments and companies. Universities, academies, and bootcamps can also buy Rhyme for their settings. You can select projects and trainings that are mission critical for you and, as well, author your own that reflect your own needs and tech environments. Please email us at help@rhyme.com
##### What kind of accessibility options does Rhyme provide?
Rhyme strives to ensure that visual instructions are helpful for reading impairments. The Rhyme interface has features like resolution and zoom that will be helpful for visual impairments. And, we are currently developing a close-caption functionality to help with hearing impairments. Most of the accessibility options of the cloud desktop's operating system or the specific application can also be used in Rhyme. If you have questions related to accessibility, please email us at accessibility@rhyme.com
##### Why don't you just use containers or virtual browsers?
We started with windows and linux cloud desktops because they have the most flexibility in teaching any software (desktop or web). However, web applications like Salesforce can run directly through a virtual browser. And, others like Jupyter and RStudio can run on containers and be accessed by virtual browsers. We are currently working on such features where such web applications won't need to run through cloud desktops. But, the rest of the Rhyme learning, authoring, and monitoring interfaces will remain the same.
##### I have a different question
Please email us at help@rhyme.com and we'll respond to you within one business day.

## More Projects by Snehan Kekre

###### Azure ML Studio: Predict Flight Delays Using Weather Data
1 hour and 6 minutes
###### scikit-learn: Fundamentals of Support Vector Machines
1 hour and 40 minutes
58 minutes
###### scikit-learn: Logistic Regression for Sentiment Analysis
1 hour and 26 minutes
41 minutes
52 minutes
###### Machine Learning Visualization: Poker Hand Classification using Random Forests
1 hour and 7 minutes
59 minutes
49 minutes
44 minutes
43 minutes
57 minutes
###### Machine Learning Visualization: Room Occupancy Detection using Indoor Climate Sensor Data (Part 1)
1 hour and 15 minutes
47 minutes
47 minutes
45 minutes
###### Machine Learning Visualization: Predicting the Compressive Strength of Concrete
1 hour and 10 minutes
52 minutes