Chapter 3
Chapter 3
Types
I N T E R M E D I AT E D ATA V I S U A L I Z AT I O N W I T H S E A B O R N
Chris Mo
Instructor
Categorical Data
Data which takes on a limited and xed number of values
Examples include:
Geography (country, state, region)
Gender
Ethnicity
Blood type
Eye color
Chris Mo
Instructor
Bicycle Dataset
Aggregated bicycle sharing data in Washington DC
Data includes:
Rental amounts
Weather information
Calendar information
sns.regplot(data=df, x='temp',
y='total_rentals', order=2)
sns.regplot(data=df,x='temp',y='total_rentals',
x_bins=4)
Chris Mo
Instructor
Getting data in the right format
Seaborn's heatmap() function requires data to be in a grid
format
pd.crosstab(df["mnth"], df["weekday"],
values=df["total_rentals"],aggfunc='mean').round(0)
sns.heatmap(df.corr())