Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Group by Region | Scatter Plots
Visualization in Python with matplotlib
course content

Зміст курсу

Visualization in Python with matplotlib

Visualization in Python with matplotlib

1. Basics: Line Charts
2. Bar Charts
3. Scatter Plots

Group by Region

Завдання

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:

  1. Iterate over pair of colors and regions, using color and region as dummy variables.
  2. Within the loop, filter the observations to a particular continent (respective value of region variable).
  3. Then, within the same loop, initialize a scatter plot of 'gdp per capita' vs 'life exp'. Set color of points to color and set the label parameter to region.
  4. Display the legend of the plot.

Завдання

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:

  1. Iterate over pair of colors and regions, using color and region as dummy variables.
  2. Within the loop, filter the observations to a particular continent (respective value of region variable).
  3. Then, within the same loop, initialize a scatter plot of 'gdp per capita' vs 'life exp'. Set color of points to color and set the label parameter to region.
  4. Display the legend of the plot.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 3. Розділ 8
toggle bottom row

Group by Region

Завдання

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:

  1. Iterate over pair of colors and regions, using color and region as dummy variables.
  2. Within the loop, filter the observations to a particular continent (respective value of region variable).
  3. Then, within the same loop, initialize a scatter plot of 'gdp per capita' vs 'life exp'. Set color of points to color and set the label parameter to region.
  4. Display the legend of the plot.

Завдання

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:

  1. Iterate over pair of colors and regions, using color and region as dummy variables.
  2. Within the loop, filter the observations to a particular continent (respective value of region variable).
  3. Then, within the same loop, initialize a scatter plot of 'gdp per capita' vs 'life exp'. Set color of points to color and set the label parameter to region.
  4. Display the legend of the plot.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 3. Розділ 8
toggle bottom row

Group by Region

Завдання

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:

  1. Iterate over pair of colors and regions, using color and region as dummy variables.
  2. Within the loop, filter the observations to a particular continent (respective value of region variable).
  3. Then, within the same loop, initialize a scatter plot of 'gdp per capita' vs 'life exp'. Set color of points to color and set the label parameter to region.
  4. Display the legend of the plot.

Завдання

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:

  1. Iterate over pair of colors and regions, using color and region as dummy variables.
  2. Within the loop, filter the observations to a particular continent (respective value of region variable).
  3. Then, within the same loop, initialize a scatter plot of 'gdp per capita' vs 'life exp'. Set color of points to color and set the label parameter to region.
  4. Display the legend of the plot.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Завдання

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:

  1. Iterate over pair of colors and regions, using color and region as dummy variables.
  2. Within the loop, filter the observations to a particular continent (respective value of region variable).
  3. Then, within the same loop, initialize a scatter plot of 'gdp per capita' vs 'life exp'. Set color of points to color and set the label parameter to region.
  4. Display the legend of the plot.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 3. Розділ 8
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt