Group by Region
Tehtävä
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
colorsandregions, usingcolorandregionas dummy variables. - Within the loop, filter the observations to a particular continent (respective value of
regionvariable). - Then, within the same loop, initialize a scatter plot of
'gdp per capita'vs'life exp'. Set color of points tocolorand set thelabelparameter toregion. - Display the legend of the plot.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 3. Luku 8
single
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
Suggested prompts:
Tiivistä tämä luku
Explain code
Explain why doesn't solve task
Awesome!
Completion rate improved to 2.94
Group by Region
Pyyhkäise näyttääksesi valikon
Tehtävä
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
colorsandregions, usingcolorandregionas dummy variables. - Within the loop, filter the observations to a particular continent (respective value of
regionvariable). - Then, within the same loop, initialize a scatter plot of
'gdp per capita'vs'life exp'. Set color of points tocolorand set thelabelparameter toregion. - Display the legend of the plot.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 3. Luku 8
single