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 integer 2016.

  • Create the first df subset from the poverty 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 xx axis and the gini variable on the yy axis.

  • Create the second subset df from the poverty 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 xx axis and the maximum poverty gap variable on the yy 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.