Data visualization with Plotly

Valentina Alto
DataSeries

--

Data visualization plays a central role whenever you want to extract information and value from your data. Python offers many libraries for that purpose, however here I’m going to talk about Plotly.

Plotly is a technical computing company that develops online data analytics and visualization tools. It can be easily installed via pip install plotly, then imported in your python notebook.

To show you some of its potentialities, I’m going to use a dataset which contains information about volcanos around the world.

Let’s have a look at our dataset:

import pandas as pd
df = pd.read_csv( "https://raw.githubusercontent.com/plotly/datasets/master/volcano_db.csv", encoding="iso-8859-1")
df.head()

A first element we might be interested to collect is the density of volcanos in each country. To do so, let’s start with plotting a histogram which counts the occurrences of each country in our dataset:

import numpy as np
import pandas as pd
df = pd.read_csv(
"https://raw.githubusercontent.com/plotly/datasets/master/volcano_db.csv", encoding="iso-8859-1")
import plotly.express as px
fig = px.histogram(df…

--

--

Valentina Alto
DataSeries

Data&AI Specialist at @Microsoft | MSc in Data Science | AI, Machine Learning and Running enthusiast