The map we’ll create with Plotly would be static when downloaded and interactive when viewed in the notebook - you’ll be able to see annotations if you hover over countries in Jupyter Notebook. The ISO codes are three-letter combination codes that designate every country. The column named “ISO-code” is essential to draw a map. csv file and display the first five lines: In the second cell in your Jupyter notebook, type this code to read the.
We’ll need a file named “Life expectancy.csv”. We’ll use the WORLD DATA by country (2020) data set - you can download it on Kaggle. We’ll create a map that will show world countries filled with different colors depending on life expectancy in a specific country. In the first line of the notebook, import all the necessary libraries: This will automatically open the Jupyter home page at Click on the “New” button in the top right corner, select the Python version installed on your machine, and a notebook will open in a new browser window. “plotly-map”) and open Jupyter Notebook by typing this command in your terminal (don’t forget to change the path):Ĭd C:\Users\Shark\Documents\code\plotly-map
PLOTLY JUPYTER NOTEBOOK TUTORIAL INSTALL
To install other tools, type this in your terminal:Ĭreate a folder that will contain your notebook (e.g. You can download the latest version of Python for Windows on the official website. Pandas: a library to prepare data for plotting.Jupyter Notebook: an online editor for data visualization.Pip: a package management system (it comes with Python).To create a choropleth map, we’ll need the following: