Compelling data and visualizations make your content stand out by making it more credible, impactful, and engaging. If you could collect and analyze any data you need yourself, you could iterate faster and find insights that your developer may never find. A small investment of time learning Python, an easy-to-learn programming language, will pay off in higher-impact content.
2. Who is the customer
and what do they
care about?
SOURCING IDEAS
AGENDA
P Y T H O N F O R D A T A -
D R I V E N S T O R Y T E L L I N G
How do we ask
relevant questions?
EXTRACTING DATA
What insights have
we discovered?
PROCESSING DATA
What story can we
tell?
VISUALIZING DATA
How do we make that
story compelling?
REFRAMING VISUALIZATION
#INBOUND19
3. WHY CODE
DATA
STORIES
P Y T H O N F O R D A T A -
D R I V E N S T O R Y T E L L I N G
Why code to create data stories when you
can hire a developer?
#INBOUND19
7. SOURCING
IDEAS
P Y T H O N F O R D A T A -
D R I V E N S T O R Y T E L L I N G
Where do we look for ideas?
#INBOUND19
8. SOURCING IDEAS
H T T P S : / / W W W . R E D D I T . C O M / R / D A T A I S B E A U T I F U L / T O P / ? T = W E E K
9. OUR ACTION PLAN
L E T ’ S R E B U I L D A N D R E F R A M E A
P O P U L A R V I S U A L I Z A T I O N
ORIGINAL
VISUALIZATION
#INBOUND19
10. OUR ACTION PLAN
L E T ’ S R E B U I L D A N D R E F R A M E A
P O P U L A R V I S U A L I Z A T I O N
REBUILT
VISUALIZATION
#INBOUND19
11. OUR ACTION PLAN
L E T ’ S R E B U I L D A N D R E F R A M E A
P O P U L A R V I S U A L I Z A T I O N
REFRAMED
VISUALIZATION
#INBOUND19
12. EXTRACTING
DATA
P Y T H O N F O R D A T A - D R I V E N
S T O R Y T E L L I N G
Pulling data that matters.
#INBOUND19
13. OUR SOURCE
DATA IS IN
MOVING
CHARTS
We need to fetch the data we need from
the JavaScript code that powers the charts
We also need to convert the data extracted
from JavaScript to Python for processing
and visualization
#INBOUND19
14. REFRAMING A POPULAR VISUALIZATION
O R I G I N A L
#INBOUND19
N O B O D Y W A N T S T O W A I T
15. R E C R E A T E D
#INBOUND19
N O B O D Y W A N T S T O W A I T
REFRAMING A POPULAR VISUALIZATION
16. R E C R E A T E D
#INBOUND19
N O B O D Y W A N T S T O W A I T
REFRAMING A POPULAR VISUALIZATION
Ride = Astro Orbitor
Ride = Disneyland Monorail
Ride = Disneyland Railroad New Orleans Square Station
Ride = Dumbo the Flying Elephant
Ride = Haunted Mansion
Ride = King Arthur Carrousel
Ride = Matterhorn Bobsleds
Ride = Mr. Toad’s Wild Ride
Ride = Space Mountain
Ride = The Many Adventures of Winnie the Pooh
Ride = Buzz Lightyear Astro Blasters
Ride = Disneyland Railroad Main Street Station
Ride = Disneyland Railroad Tomorrow Station
Ride = Finding Nemo Submarine Voyage
Ride = Jungle Cruise
Ride = Mad Tea Party
Ride = Millennium Falcon: Smugglers Run
Ride = Pirates of the Caribbean
Ride = Star Tours: The Adventure Continue
Ride = It’s a Small World
17. R E F R A M E D
#INBOUND19
E M O T I O N A L C O N N E C T I O N
REFRAMING A POPULAR
VISUALIZATIONEnjoymentscore
18. R E F R A M E D
#INBOUND19
E M O T I O N A L C O N N E C T I O N
REFRAMING A POPULAR
VISUALIZATION
SurveyRating
19. R E F R A M E D
#INBOUND19
E M O T I O N A L C O N N E C T I O N
REFRAMING A POPULAR
VISUALIZATIONWaitTimeEnjoymentScore
20. S T E P S T O R E C R E A T E
V I S U A L I Z A T I O N
We will extract our
data points from
the source charts
and tables
EXTRACT
We will convert
source format to
format expected by
the visualization
TRANSFORM
PROCESS
We will represent
the data visually
PRESENT
#INBOUND19
REFRAMING A POPULAR
VISUALIZATION
We will ask a
different question
and display a new
visualization
REFRAME
21. WHY
REFRAME
POPULAR
STORIES
P Y T H O N F O R D A T A - D R I V E N
S T O R Y T E L L I N G
Popular data stories lack the emotional
hook
#INBOUND19
22. THE MARKETER
VS. THE ENGINEER
E M O T I O N V S . L O G I C
Marketers look for emotions. Engineers are focused on logic.
In order to overcome the disconnect and capitalize on our
connection to our target audience, we need to bridge the gap
between the two.
#INBOUND19
25. EXTRACTING OUR
SOURCE DATA
#INBOUND19
We are going to complete these steps to
extract the ride durations:
1. Use Google Chrome to get an HTML DOM
element selector with the ride durations
2. Use requests-html to extract the elements
from the source page
3. Use a simple regular expression for
duration numbers
33. #INBOUND19
U S E R E Q U E S T S - H T M L T O E X T R A C T T H E R I D E D U R A T I O N S
EXTRACTING OUR SOURCE DATA
34. #INBOUND19
U S E R E G U L A R E X P R E S S I O N S T O E X T R A C T T H E D U R A T I O N S
EXTRACTING OUR SOURCE DATA
35. #INBOUND19
We are going to complete these steps to extract the average
wait times:
1. Use requests-html to extract the JavaScript snippets from
the source page
2. Use regular expressions to extract the data rows from the
JavaScript code and also the ride name/title of the chart
3. Use a Jinja2 template to generate a custom JavaScript
function to grab the data extracted for each chart
4. Use Py_mini_tracer to execute the custom JavaScript
function and get the data in Python format
EXTRACTING OUR SOURCE DATA
38. #INBOUND19
U S E R E G U L A R E X P R E S S I O N S T O E X T R A C T T H E D A T A
R O W S F R O M T H E J A V A S C R I P T C O D E A N D A L S O T H E
R I D E N A M E / T I T L E O F T H E C H A R T
EXTRACTING OUR SOURCE DATA
39. #INBOUND19
U S E A J I N J A 2 T E M P L A T E T O G E N E R A T E A C U S T O M J A V A S C R I P T
F U N C T I O N T O R E T U R N T H E D A T A E X T R A C T E D
EXTRACTING OUR SOURCE DATA
40. PROCESSING
DATA
P Y T H O N F O R D A T A -
D R I V E N S T O R Y T E L L I N G
How do we process this data to gain
valuable insights?
#INBOUND19
41. PROCESSING OUR
SOURCE DATA
#INBOUND19
We are going to complete these steps:
1. Split the extracted dataset into two Python
dictionaries. One with the timestamps and one with
the wait times per ride
2. Filter rides with fewer than 64 data points to keep
the same number of data rows per ride
3. Calculate average number wait time per ride
4. Combine average wait time per ride and ride
duration into one data frame
5. Eliminate rows with empty columns
43. #INBOUND19
S P L I T T H E E X T R A C T E D D A T A S E T I N T O T W O P Y T H O N D I C T I O N A R I E S .
O N E W I T H T H E T I M E S T A M P S A N D O N E W I T H T H E W A I T T I M E S P E R
R I D E
PROCESSING OUR SOURCE DATA
44. #INBOUND19
S P L I T T H E E X T R A C T E D D A T A S E T I N T O T W O P Y T H O N D I C T I O N A R I E S .
O N E W I T H T H E T I M E S T A M P S A N D O N E W I T H T H E W A I T T I M E S P E R
R I D E
PROCESSING OUR SOURCE DATA
45. #INBOUND19
S P L I T T H E E X T R A C T E D D A T A S E T I N T O T W O P Y T H O N D I C T I O N A R I E S .
O N E W I T H T H E T I M E S T A M P S A N D O N E W I T H T H E W A I T T I M E S P E R
R I D E
PROCESSING OUR SOURCE DATA
46. #INBOUND19
F I L T E R R I D E S W I T H F E W E R T H A N 6 4 D A T A P O I N T S T O K E E P T H E
S A M E N U M B E R O F D A T A R O W S P E R R I D E
PROCESSING OUR SOURCE DATA
47. #INBOUND19
C A L C U L A T E A V E R A G E W A I T T I M E P E R R I D E
PROCESSING OUR SOURCE DATA
48. #INBOUND19
C O M B I N E A V E R A G E W A I T T I M E P E R R I D E A N D R I D E D U R A T I O N I N T O
O N E D A T A F R A M E
PROCESSING OUR SOURCE DATA
49. #INBOUND19
E L I M I N A T E E M P T Y C O L U M N S
PROCESSING OUR SOURCE DATA
50. VISUALIZING
DATA
P Y T H O N F O R D A T A -
D R I V E N S T O R Y T E L L I N G
How do we tell a story?
#INBOUND19
51. VISUALIZING OUR
SOURCE DATA
#INBOUND19
We are going to complete these steps:
1. Convert pandas data frame to a row
oriented dictionary. X axis is Average Wait
Time and y axis is Ride Duration. Label is
the Ride name.
2. Use plotly to generate a labeled scatter
plot
53. #INBOUND19
C O N V E R T P A N D A S D A T A F R A M E T O A R O W O R I E N T E D D I C T I O N A R Y .
X A X I S I S A V E R A G E W A I T T I M E A N D Y A X I S I S R I D E D U R A T I O N
VISUALIZING OUR SOURCE DATA
54. #INBOUND19
T H I S I S T H E R E B U I L T C H A R T
VISUALIZING OUR SOURCE DATA
55. REFRAMING
VISUALIZATION
P Y T H O N F O R D A T A - D R I V E N
S T O R Y T E L L I N G
How do we connect with our customer
with a compelling visualization?
#INBOUND19
56. REFRAMING OUR
VISUALIZATION
#INBOUND19
We are going to complete these steps to make an
emotional connection:
1. We want to know which age groups will have the most
fun per ride
2. We will fetch the average ride ratings per age group
from https://touringplans.com/disneyland/attractions
3. We will calculate an “Enjoyment Score” per ride and
age group, which is the number of minutes per ride
divided by average minutes of wait time.
4. We will use plotly to display a bar chart with the results
57. #INBOUND19
W E W I L L F E T C H T H E A V E R A G E R I D E R A T I N G S P E R A G E G R O U P
F R O M H T T P S : / / T O U R I N G P L A N S . C O M / D I S N E Y L A N D / A T T R A C T I O N S
REFRAMING OUR VISUALIZATION
58. #INBOUND19
W E W I L L C A L C U L A T E A N ” E N J O Y M E N T S C O R E ” P E R R I D E A N D A G E
G R O U P , W H I C H I S T H E N U M B E R O F M I N U T E S P E R R I D E D I V I D E D B Y
A V E R A G E M I N U T E S O F W A I T T I M E .
REFRAMING OUR VISUALIZATION
59. #INBOUND19
W E W I L L U S E P L O T L Y T O D I S P L A Y A B A R C H A R T W I T H T H E
E N J O Y M E N T S C O R E F O R E A C H G R O U P ’ S F A V O R I T E R I D E S
REFRAMING OUR VISUALIZATION
60. #INBOUND19
At the lower end are the age groups who are more
willing to wait for their favorite rides, and at the
higher end are those who prefer to rides with short
wait times or longer ride times.
H O W W O U L D I I N T E R P R E T T H I S ?
REFRAMING OUR VISUALIZATION
EnjoymentScore
61. #INBOUND19
H O W W O U L D I I N T E R P R E T T H I S ?
REFRAMING OUR VISUALIZATION
Same as before but broke down by ride where x-axis has ride names
EnjoymentScoreSurveyRating
62. #INBOUND19
H O W W O U L D I I N T E R P R E T T H I S ?
REFRAMING OUR VISUALIZATION
Same as before but x-axis has age groups and we limit rides to top 5
EnjoymentScoreSurveyRating
63. ADDITIONAL
IDEAS
P Y T H O N F O R D A T A - D R I V E N
S T O R Y T E L L I N G
Here are some additional reframing ideas
#INBOUND19
64. REFRAMING OTHER
SUCCESSFUL
VISUALIZATIONS
D A T A I S B E A U T I F U L
You can reproduce examples for different verticals from the
subreddit https://www.reddit.com/r/dataisbeautiful/ see also
https://www.import.io/post/8-fantastic-examples-of-data-
storytelling/
#INBOUND19
66. REFRAMING SUCCESS
IN TRAVEL
P L A N N I N G F O R E N J O Y M E N T
#INBOUND19
PLAN FOR KIDS
PLAN FOR TEENS
PLAN FOR ADULTS
67. REFRAMING SUCCESS
IN RECRUITMENT
N O B O D Y W A N T S T O
L O S E T H E I R J O B S
#INBOUND19
GROWTH OF JOBS BY TYPE PER CITY
SALARY GROWTH POTENTIAL BY TYPE PER CITY
68. REFRAMING SUCCESS
IN RECRUITMENT
N O B O D Y W A N T S T O L O S E
T H E I R J O B S
#INBOUND19
TYPES OF JOBS GROWING BY REGION,
POST-TARIFFS
REGIONS WITH JOB GROWTH,
POST-TARIFFS
69. REFRAMING SUCCESS
IN OFFICE SPACE
L O C A T I O N , L O C A T I O N , L O C A T I O N
#INBOUND19
BEST CITIES FOR COMMERCIAL
REAL ESTATE
WORST CITIES FOR COMMERCIAL
REAL ESTATE
70. REFRAMING SUCCESS
IN REAL ESTATE
N O B O D Y W A N T S N O I S E
#INBOUND19
LOW NOISE BUT CONVENIENT
BANG FOR YOUR BUCK
71. HOW TO ASK
REFRAMING
QUESTIONS
P Y T H O N F O R D A T A - D R I V E N
S T O R Y T E L L I N G
Using the information refinement framework
#INBOUND19
72. INFORMATION
REFINEMENT
U S I N G P O W E R F U L I N S I G H T S
T O T A R G E T Y O U R A U D I E N C E
Interactive visualizations can display data in meaningful ways.
When you view this data, you can recognize trends, patterns, and
correlations, which are also referred to as phenomena. By
recognizing these phenomena, you are able to transform that
information into knowledge within a given context. Then you can
make valuable insights that will direct your content.
#INBOUND19
73. Dave Campbell, a Technical Fellow at Microsoft, has a very effective model of
information refinement. The sequence is Signal > Data > Information >
Knowledge > Insight.
As you refine and iterate on the data, you increase the value of it.
GET
CREATIVE
WITH DATA
#INBOUND19
74. 74
#INBOUND19
When we see the best outcomes,
we’ve gained wisdom and then can
make impactful decisions that are
informed and scalable.
DIKW PYRAMID
DATA
INFORMATION
KNOWLEDGE
WISDOM
75. Data Information Knowledge Understanding Wisdom
Description:
What
Instruction:
How to
Explanation:
Why
WHAT
IS BEST:
Doing things right Doing the right things
PAST FUTURE
DIKW
T
U
D I K U W
76. 76
DIKW
DATA INFORMATION KNOWLEDGE WISDOM
DIKW through the eyes of IoT company AGT as mentioned on Electronics 360 – a focus on decisions and actions
Given purpose
becomes
Given insight
becomes
Given meaning
becomes
Given context
becomes
DECISIONS
Change, movement
WISDOM
Understanding, integrated, actionable
KNOWLEDGE
Contextual, synthesized
INFORMATION
Useful, organized, structured
DATA
Signals, know-nothing
FUTURE WHAT ACTION?
Reveals direction
WHAT IS BEST?
Reveals principles
PAST
WHY?
Reveals patterns
WHAT?
Reveals relationships
ANALYTICS
77. START WITH THE
POSSIBLE
OUTCOMES
C R E A T I V I T Y I S N O T
S E Q U E N T I A L
Sometimes, we have to start at the place where we are
familiar and work backwards, then forwards, or in some
pattern that does not always follow this neat DIKW path that
leads us to wisdom.
#INBOUND19
78. "KNOWLEDGE IS MORE
CREATIVE, MESSIER, HARDER
WON, AND FAR MORE
DISCONTINUOUS."
DAVID WEINBERGER, SENIOR RESEARCHER
AT HARVARD’S BERKMAN KLEIN CENTER
FOR INTERNET & SOCIETY, AND THE
AUTHOR OF EVERYDAY CHAOS
#INBOUND19
80. BRIDGING GAPS
ALONG DIKW PATH
C R E A T I V E P R O B L E M
S O L V I N G
Answer to the
proof and existing
understanding
DATA &
INFORMATION
Integrated solution that
connected the gaps.
WISDOM
SOLUTION
Challenging
problem recalled
from memory.
KNOWLEDGE &
INFORMATION
#INBOUND19
81. WHY TELL
DATA
STORIES
P Y T H O N F O R D A T A - D R I V E N
S T O R Y T E L L I N G
This is a lot of work! Why do it?
#INBOUND19
82. RIDING THE WAVE
D R I V I N G D E M A N D T O Y O U R
P R O D U C T
One of the biggest misconceptions about marketing is that you
need to manufacture desire, demand for your product and
services. But, if you look at the most successful businesses,
they tap into existing demand.
#INBOUND19
83. "LET ME REPEAT. THIS MASS DESIRE
MUST ALREADY BE THERE. IT MUST
ALREADY EXIST. YOU CANNOT
CREATE IT. AND YOU CANNOT FIGHT
IT. BUT, YOU CAN -- AND MUST --
DIRECT IT, CHANNEL IT. FOCUS IT
ONTO YOUR PARTICULAR PRODUCT”
EUGENE M. SCHWARTZ,
BREAKTHROUGH ADVERTISING
#INBOUND19
85. RIDING THE WAVE
D R I V I N G D E M A N D T O
Y O U R P R O D U C T
You need two things to channel existing demand
into your product or service: narrow down your
target customer, and present a message that
makes an emotional connection with them.
#INBOUND19
86. RIDING THE WAVE
D R I V I N G D E M A N D T O
Y O U R P R O D U C T
Why narrow down? Different emotions appeal to
different groups of customers.
How do you make emotional connections? You
tell relatable stories.
Data-driven storytelling is a powerful way to make
emotional connections with your target audience.
#INBOUND19
87. Data-driven content can unlock emotions.
I sourced some examples from creative campaign award sites.
Companies such as Whirlpool, Shapermint, and others are
concrete case studies of this approach in action--and they all
have strong outcomes.
This is like riding a big demand wave, but you need to be
pulled in.
DATA
ANALYSIS
CAN HELP
US FIND
EMOTIONAL
INSIGHTS
#INBOUND19
88. 70 90 50 3030
Improved student
attendance and
participation by putting
washers and dryers in
schools
WHIRLPOOL
Discovered 67% of
women account for less
than 2% of online
images. Started a viral
social media campaign.
REFINERY29
Increased
engagement rate by
300% and sales by a
third with education
marketing.
HUGGIES
Generated $50 million
in sales in less than 9
months with viral
Facebook campaign.
SHAPERMINT
Beat 80% small
business failure rate
with interactive
smartphone marketing.
SPERBANK
SUCCESSFUL DATA-
DRIVEN STORIES
C A S E S T U D I E S
#INBOUND19
89. GOAL
CAMPAIGN
To solve a socio-economic problem that they could
leverage with their brand
Whirlpool donated washers and dryers to the
schools with the most at-risk children and tracked
attendance
PROBLEM
RESULTS
They discovered that every day 4,000 students
drop out of school because they cannot afford to
keep their clothes clean
The brand found 90% of these students had
improved attendance rates and nearly as many
improved in class participation
WHIRLPOOL
D A T A S T O R Y
#INBOUND19
90. GOAL
CAMPAIGN
.To accurately represent women in online images. .
They partnered with Getty Images to create new
collections of stock photos that were more
inclusive. They also disseminated the hashtag
#seethe67 on social media to bring attention to the
issue
PROBLEM
RESULTS
They did a deep dive into the data on their
audience and found that while 67% of women are
plus-size, only 2% of images represent that reality
With this consumer insight, they established
themselves as authentic and supportive voice for
the wide range of women in their target audience.
REFINERY29
D A T A S T O R Y
#INBOUND19
91. GOAL
CAMPAIGN
Huggies wanted to be the diaper leader to new
mothers as a trusted brand, but needed a
compelling narrative for consumers to trust them
more than their competitors
They looked at over 600 studies and found that
they could leverage the essence of their brand
name--”hugs”--to educate new mothers about skin-
to-skin contact and promote volunteer baby holding
programs in Canadian hospitals
PROBLEM
RESULTS
In Canada, Pampers had 100% of the market share
in hospitals
This campaign was wildly successful, and they’ve
seen their engagement rate increase to 300% and
their sales increase by nearly a third.
HUGGIES
D A T A S T O R Y
#INBOUND19
92. GOAL
CAMPAIGN
The bank wanted to support small enterprise
business owners
In order to increase the probability of small
businesses beating these odds, they reverse
engineered the lending process by soliciting
neighborhood passerby to provide feedback on the
types of businesses that they’d like to patronize
PROBLEM
RESULTS
They realized the risks of only 20% of these
borrowers’ businesses surviving after two years
This campaign helped the bank make better
decisions about lending and was so successful that
real estate developers wanted to partner with
them.
SPERBANK
D A T A S T O R Y
#INBOUND19
93. GOAL
CAMPAIGN
To help build community and acceptance of
different body types.
They spearheaded the #thisismytruth campaign
which--much like the Dove “Real Beauty” Campaign
from over a decade ago--promoted body positivity
PROBLEM
RESULTS
Most images and branding on the web doesn’t
reflect the reality of women
In less than 9 months, they generated over 50
million in sales
SHAPERMINT
D A T A S T O R Y
#INBOUND19