Exercise: Visualizing Datasets
Check your understanding of creating visualizations using Plotly.
We'll cover the following
Let’s practice what we have learned so far.
Tasks
Refactor the Python code below to follow the tasks listed:
-
Create a
gini
variable, and store the string'GINI index (World Bank estimate)'
. -
Create a
year
variable, and store the integer2016
. -
Create the first
df
subset from thepoverty
dataset to get the poverty rates for all countries in the year 2016, and sort them based on their Gini index scores. -
Plot a bar chart using the subset created in the previous task with the
Country Name
on the axis and thegini
variable on the axis. -
Create the second subset
df
from thepoverty
dataset to get the highest poverty gap values for the United States for all the years. -
Plot a scatter graph using the subset created in the previous task with
df['year']
on the axis and the maximum poverty gap variable on the axis.
Coding workspace
The provided workspace contains the required libraries and datasets. Try to code the solution for the tasks mentioned above.
Get hands-on with 1400+ tech skills courses.