Looking at the farmers market data IMP R OVIN G YOU R DATA VISU AL IZATION S IN P YTH ON Nick Stra y er Instr u ctor
First e x plorations of a dataset Take a broad v ie w Sho w as m u ch info as possible Don ' t f u ss o v er appearances IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
Using y o u r head () pollution.head() IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
# Just show median pollution.describe(percentiles=[0.5] # Describe all columns include='all') IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
pd.plotting.scatter_matrix(pollution, alpha = 0.2); IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
markets.head() IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
Let ' s e x plore o u r data IMP R OVIN G YOU R DATA VISU AL IZATION S IN P YTH ON
E x ploring the patterns IMP R OVIN G YOU R DATA VISU AL IZATION S IN P YTH ON Nick Stra y er Instr u ctor
Digging in deeper In v estigating correlations Are correlations dri v en b y confo u nding ? An y thing s u rprising ? IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
Target a u diences Shared w ith peers Be smart abo u t design decisions Remember the y aren ' t as familiar w ith data IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
sns.regplot('NO2', 'CO', ci=False, data=pollution, # Lower opacity of points scatter_kws={'alpha':0.2, 'color':'grey'} ) IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
Profiling patterns Fo u nd interesting pa � ern in data Ho w to q u ickl y e x plore and e x plain the pa � ern ? Use te x t ! IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
Using te x t scatters to id o u tliers IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
g = sns.scatterplot("SO2","CO", data=long_beach_avgs) # Iterate over the rows of our data for _, row in long_beach_avgs.iterrows(): # Unpack columns from row month, SO2, CO = row # Draw annotation in correct place g.annotate(month, (SO2,CO)) plt.title('Long Beach avg SO2 by CO') IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
Let ' s dig in IMP R OVIN G YOU R DATA VISU AL IZATION S IN P YTH ON
Making y o u r v is u ali z ations efficient IMP R OVIN G YOU R DATA VISU AL IZATION S IN P YTH ON Nick Stra y er Instr u ctor
What is efficient ? Red u ce the e � ort needed to see stor y Re - organi z e plots to keep foc u s Impro v e ' ink ' to info ratio Don ' t compromise the message IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
# Create a subplot w/ one row & two columns. f, (ax1, ax2) = plt.subplots(1, 2) # Pass each axes to respective plot sns.lineplot('month', 'NO2', 'year', ax=ax1, data=pol_by_month) sns.barplot('year', 'count', ax=ax2, data=obs_by_year) IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
Clear u nnecessar y legends IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
sns.lineplot('month', 'NO2', 'year', ax=ax1, data=pol_by_month, palette='RdBu',) sns.barplot('year', 'count', 'year', ax=ax2, data=obs_by_year, palette='RdBu', dodge=False) # Remove legends for both plots ax1.legend_.remove() ax2.legend_.remove() IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
Let ' s practice IMP R OVIN G YOU R DATA VISU AL IZATION S IN P YTH ON
T w eaking y o u r plots IMP R OVIN G YOU R DATA VISU AL IZATION S IN P YTH ON Nick Stra y er Instr u ctor
Looking at the small things P u t y o u rself into the v ie w er ' s shoes IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
Is the aesthetic appropriate ? Is the aesthetic appropriate for the conte x t ? IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
Font - si z es Is e v er y thing legible ? IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
Remo v ing spines from plots IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
Remo v ing spines from plots IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
Let ' s t w eak some plots IMP R OVIN G YOU R DATA VISU AL IZATION S IN P YTH ON
Wrap - Up IMP R OVIN G YOU R DATA VISU AL IZATION S IN P YTH ON Nick Stra y er Instr u ctor
IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
Using color responsibl y IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
Going f u rther Blogs Flo w ing data C u rated list of data v is u ali z ations . Data w rapper Blog Articles that dig deep into v is u ali z ation techniq u es and mistakes . T w i � er # data v is An ongoing stream of cool projects and inspiration . IMPROVING YOUR DATA VISUALIZATIONS IN PYTHON
Thank y o u! IMP R OVIN G YOU R DATA VISU AL IZATION S IN P YTH ON
Recommend
More recommend