Reader small image

You're reading from  Interactive Dashboards and Data Apps with Plotly and Dash

Product typeBook
Published inMay 2021
Reading LevelBeginner
PublisherPackt
ISBN-139781800568914
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Elias Dabbas
Elias Dabbas
author image
Elias Dabbas

Elias Dabbas is an online marketing and data science practitioner. He produces open-source software for building dashboards, data apps, as well as software for online marketing, with a focus on SEO, SEM, crawling, and text analysis.
Read more about Elias Dabbas

Right arrow

Exploring choropleth maps

Choropleth maps are basically colored polygons representing a certain area on a map. Plotly ships with country maps included (as well as US states), and so it is very easy to plot maps if we have information about countries. We already have such information in our dataset. We have country names, as well as country codes, in every row. We also have the year, some metadata about the countries (region, income group, and so on), and all the indicator data. In other words, every data point is connected to a geographical location. So, let's start by choosing a year and an indicator, and see how the values of our chosen indicator vary across countries:

  1. Open the poverty file into a DataFrame and create the year and indicator variables:
    import pandas as pd
    poverty = pd.read_csv('data/poverty.csv')
    year = 2016
    indicator = 'GINI index (World Bank estimate)'
  2. Create a subset of poverty with values from the selected year and containing...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Interactive Dashboards and Data Apps with Plotly and Dash
Published in: May 2021Publisher: PacktISBN-13: 9781800568914

Author (1)

author image
Elias Dabbas

Elias Dabbas is an online marketing and data science practitioner. He produces open-source software for building dashboards, data apps, as well as software for online marketing, with a focus on SEO, SEM, crawling, and text analysis.
Read more about Elias Dabbas