Interactive Visualization - Jupyter Notebook
Interactive Visualization - Jupyter Notebook
In [2]: 1 df = px.data.gapminder()
2 df.head()
Out[2]:
country continent year lifeExp pop gdpPercap iso_alpha iso_num
In [3]: 1 df.dropna()
2 df.isna().sum()
Out[3]: country 0
continent 0
year 0
lifeExp 0
pop 0
gdpPercap 0
iso_alpha 0
iso_num 0
dtype: int64
In [4]: 1 df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 1704 entries, 0 to 1703
Data columns (total 8 columns):
country 1704 non-null object
continent 1704 non-null object
year 1704 non-null int64
lifeExp 1704 non-null float64
pop 1704 non-null int64
gdpPercap 1704 non-null float64
iso_alpha 1704 non-null object
iso_num 1704 non-null int64
dtypes: float64(2), int64(3), object(3)
memory usage: 106.6+ KB
In [5]: 1 df = df.iloc[:,:-2]
2 df.head(2)
Out[5]:
country continent year lifeExp pop gdpPercap
90
80
70
lifeExp
60
50
40
https://datalab.karunya.edu/user/urk20ai1038/notebooks/Data Visualization/Interactive Visualization.ipynb 3/4
11/2/22, 10:15 PM Interactive Visualization - Jupyter Notebook
40
30
2 3 4 5 6 7 8 9 2 3 4 5 6 7 8 9 2 3 4 5 6 7 8 9
100 1000 10k 10
gdpPercap
year=2007
▶ ◼
In [ ]: 1