Course Content
Visualization in Python with matplotlib
Visualization in Python with matplotlib
Group by Region
Task
Swipe to begin your solution
Let's build a new scatter plot with the same data, but this time painting the points with respect to the region (the 'continent'
column). Follow the next steps:
- Iterate over pair of
colors
andregions
, usingcolor
andregion
as dummy variables. - Within the loop, filter the observations to a particular continent (respective value of
region
variable). - Then, within the same loop, initialize a scatter plot of
'gdp per capita'
vs'life exp'
. Set color of points tocolor
and set thelabel
parameter toregion
. - Display the legend of the plot.
Solution
Switch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?
Thanks for your feedback!
Section 3. Chapter 8
Group by Region
Task
Swipe to begin your solution
Let's build a new scatter plot with the same data, but this time painting the points with respect to the region (the 'continent'
column). Follow the next steps:
- Iterate over pair of
colors
andregions
, usingcolor
andregion
as dummy variables. - Within the loop, filter the observations to a particular continent (respective value of
region
variable). - Then, within the same loop, initialize a scatter plot of
'gdp per capita'
vs'life exp'
. Set color of points tocolor
and set thelabel
parameter toregion
. - Display the legend of the plot.
Solution
Switch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?
Thanks for your feedback!
Section 3. Chapter 8
Switch to desktop for real-world practiceContinue from where you are using one of the options below