Group by Region
Aufgabe
Swipe to start coding
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.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 3. Kapitel 8
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen
Awesome!
Completion rate improved to 2.94
Group by Region
Swipe um das Menü anzuzeigen
Aufgabe
Swipe to start coding
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.
Lösung
War alles klar?
Danke für Ihr Feedback!
Awesome!
Completion rate improved to 2.94Abschnitt 3. Kapitel 8
single