0% found this document useful (0 votes)
5 views

02_data_viz

The document outlines a workshop series on data visualization using Python, covering topics such as Matplotlib, Seaborn, and Bokeh, along with exploratory data analysis in R and Tableau. It emphasizes the importance of visualization for data analysis, communication, and hypothesis confirmation, while introducing useful Python libraries like NumPy and pandas. The workshop also includes hands-on learning opportunities and interactive tools for creating visualizations.

Uploaded by

vasantha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

02_data_viz

The document outlines a workshop series on data visualization using Python, covering topics such as Matplotlib, Seaborn, and Bokeh, along with exploratory data analysis in R and Tableau. It emphasizes the importance of visualization for data analysis, communication, and hypothesis confirmation, while introducing useful Python libraries like NumPy and pandas. The workshop also includes hands-on learning opportunities and interactive tools for creating visualizations.

Uploaded by

vasantha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

DATA VISUALIZATION

USING PYTHON

D-VELOP WORKSHOP SERIES – Summer 2021


Trevor Bonjour

1
D-VELOP WORKSHOP SERIES – Summer 2021

• Data Visualization: ggplot2


Jun 9

• Data Visualization using Python: Matplotlib and Seaborn


Jun 16

• Exploratory Data Analysis in R


Jun 23

• Data Visualization using Python: Bokeh (Interactive Plots)


July 7

• Exploring and Visualizing Time Series Data


July 14

• Data Visualization: Introduction to Tableau


July 21

2
What will we cover today?

§ Motivation
§ Useful Python Libraries
§ Usages of Bokeh
§ Interactive Tools
§ Learn by Doing

3
Visualization Objectives

§ Record information
§ Analyze data to support reasoning
§ Confirm hypotheses
§ Communicate ideas to others

4
Why Visualize
To record information

5
Why Visualize
To point out interesting things

6
Why Visualize
To point out interesting things

7
Why Visualize
To communicate information

8
Why Visualize
To analyze data

2020 US Elections (NYTimes)


9
Useful Python Libraries

NumPy pandas matplotlib seaborn bokeh

10
NumPy

§ Fundamental package for scientific computing


§ Exceptionally fast – written in C
§ Main data structure:
• ndarray : n-dimensional arrays of homogeneous data types
§ Data manipulation ≈ NumPy array manipulation
§ Used in other libraries - Matplotlib, pandas, scikit- learn

Link: NumPy for MATLAB USERS

11
Pandas

§ Fundamental tool for handling and analyzing input data


§ Particularly suited for tabular data
§ Implements powerful data operations
§ Main data structures:
• DataFrame: A table with rows and columns
• Series: A single column

12
Matplotlib

§ Used for basic plotting


§ Highly customizable
§ Works with NumPy and pandas

13
Seaborn

§ Used for statistical data visualization


§ Uses fewer syntax with good default themes
§ Integrated to work great with pandas data-frame
§ Uses Matplotlib under the hood

14
Bokeh

§ Used for interactive visualization


§ Requires modern web browsers
§ Integrates with JavaScript

15
What is Bokeh used for?

§ Build Data Applications


§ Interactively Explore Data
§ Publish Dashboards
§ Visualize Streaming Data
§ Add content to Web Pages

16
Build Data Applications

17
Interactively Explore Data

18
Publish Dashboards

19
Visualize Streaming Data

20
Add content to Web Pages

21
Basic Interactive Tools

§ Gesture Tools:
• pan, drag, pinch, scroll

§ Action Tools:
• redo, reset, save, zoom in

§ Inspector Tools:
• hover, crosshair

22
Linking
Link plots to add connected interactivity between plots

§ Linked Panning
• Link pan or zooming actions across many
plots

§ Linked Brushing
• Shared data sources between renderers

§ Linked Properties
• Link values of model properties together
so that they remain synchronized

23
Interactive Legend
Bokeh plots can be made interactive so that clicking or tapping on the
legend entries will hide or mute the entries

24
Widgets
Widgets are interactive controls that can be added to Bokeh applications to
provide a front end user interface to a visualization.

§ Computations
§ Update Plots
§ Connect to other programmatic functionality
§ Examples: checkbox, sliders, table, tabs,
dropdown, multi-choice, radio-buttons

25
Widget Callbacks
To use widgets, add them to the document and define their callbacks.

§ CustomJS callback
§ Event Handlers:
• Python functions that can be attached to widgets.
• Called when certain attributes on the widget are
changed.
§ Attached using: on_change, on_click, etc.

26
LEARN BY DOING

To access the videos and material from the workshop series please visit:
https://guides.lib.purdue.edu/d-velop

27

You might also like