Book Image

Interactive Data Visualization with Python - Second Edition

By : Abha Belorkar, Sharath Chandra Guntuku, Shubhangi Hora, Anshu Kumar
Book Image

Interactive Data Visualization with Python - Second Edition

By: Abha Belorkar, Sharath Chandra Guntuku, Shubhangi Hora, Anshu Kumar

Overview of this book

With so much data being continuously generated, developers, who can present data as impactful and interesting visualizations, are always in demand. Interactive Data Visualization with Python sharpens your data exploration skills, tells you everything there is to know about interactive data visualization in Python. You'll begin by learning how to draw various plots with Matplotlib and Seaborn, the non-interactive data visualization libraries. You'll study different types of visualizations, compare them, and find out how to select a particular type of visualization to suit your requirements. After you get a hang of the various non-interactive visualization libraries, you'll learn the principles of intuitive and persuasive data visualization, and use Bokeh and Plotly to transform your visuals into strong stories. You'll also gain insight into how interactive data and model visualization can optimize the performance of a regression model. By the end of the course, you'll have a new skill set that'll make you the go-to person for transforming data visualizations into engaging and interesting stories.
Table of Contents (9 chapters)

Interactive Scatter Plots

As you know by now, scatter plots are one of the most essential types of plots for presenting global patterns within a dataset. Naturally, it is important to know how to introduce interactivity in these plots. We will first look at the zoom and reset actions on plots. Before that, though, let's have a look at the dataset.

We can view the HPI dataset using the following code:

import pandas as pd
#Download the data from Github repo 
hpi_url = "https://raw.githubusercontent.com/TrainingByPackt/Interactive-Data-Visualization-with-Python/master/datasets/hpi_data_countries.tsv"
# Once downloaded, read it into a DataFrame using pandas
hpi_df = pd.read_csv(hpi_url, sep='\t')
hpi_df.head()

The output is as follows:

Figure 4.1: HPI dataset

Note that there are 5 numerical/quantitative features in this dataset: Life Expectancy (years)Wellbeing (0-10)Inequality of outcomesEcological Footprint...