Intro to Plotly Express

In this notebook I’ll try to explore gapminder dataset using interactive data visualization library called Plotly. About the Dataset: Data Source

Import Libraries

import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import plotly.express as px # for visualization 
import plotly.offline as py 
import plotly.graph_objs as go 
from plotly.figure_factory import create_table # for creating nice table 

Loading the Dataset

# load built-in gapminder dataset from plotly 
gapminder = px.data.gapminder() 
# examine first few rows 
gapminder.head() 
country continent year lifeExp pop gdpPercap iso_alpha iso_num
0 Afghanistan Asia 1952 28.801 8425333 779.445314 AFG 4
1 Afghanistan Asia 1957 30.332 9240934 820.853030 AFG 4
2 Afghanistan Asia 1962 31.997 10267083 853.100710 AFG 4
3 Afghanistan Asia 1967 34.020 11537966 836.197138 AFG 4
4 Afghanistan Asia 1972 36.088 13079460 739.981106 AFG 4

Creating a Table

# create a publication quality table 
table = create_table(gapminder.head(10))
py.iplot(table)