Data Visualization
Lecture
Welcome to Data!
Big Data, Machine Learning, and their Real World Applications
Pre-College Program
Columbia University, SPS
Recap of EDA
• Pandas library
• DataFrames
• Pandas methods and attributes
• Series
• Visualizing a Dataset
• Filtering
• Indexing
groupby() method
• Aggregates data
by a category
over a column or
groups of
columns.
groupby() method
EDA Continued- if you want to know…
• Pivot tables
• Joining , concatenating , and merging dataframes
What we will learn
• Best practices
• Matplotlib
• Scatterplots
• Line plots
• Bar charts
• Boxplots
• Histograms
Why and How to Visualize Data?
• Communicate your results better!
• Visualize to find patterns and analyze the data
• So many choices…which one to choose?
Good graphs consist of
• Title
• X axis label
• Y axis label
• Legends
Bad Plot Examples
Matplotlib
• Let’s take a dive , look into [Link] and click on
examples. Explore the different types of graphs there are.
Our First Plot in Python
Adding Title, Style, and Axes Labels
Plotting Numerical and Categorical Data
• Numerical vs numerical – line plots , scatter plots, histograms
• Categorical vs numerical – bar charts, boxplots
Scatterplots
Activity
• Spend a few minutes looking at different variables and plotting
scatterplots for the Pokemon dataset (or your own dataset). Do you
see any correlations?
• Pro Tip: Look up what a “pair plot” is (you will need another library to
plot it).
Line Plots
Bar Charts
• X- axis contains
categorical values
• Y-axis contains
numerical values
• Categorical vs
numerical
Bar Charts
Bar Charts
Boxplots
Histograms
Pie Charts
Which graph to
choose?
[Link]
Seaborn
• Statistical data visualization
• A step up in design from matplotlib
• [Link]
Plotly Express
• Welcome to interactive plots!
• [Link]
Visualization Assignment
• Continue your data exploration
• Create at least 5 plots
• Try to use a variety of plots
• Write down your observations with markdown cells