Course Content
Analyzing and Visualizing Real-World Data
Analyzing and Visualizing Real-World Data
Or is it Holiday Effect?
Let's find out if holidays could be the cause. To do this, we will display the dates next to the points.
Swipe to show code editor
-
Add a
hue
parameter to the.scatterplot()
function so that the points will be colored in accordance to the values in the'Holiday_Flag'
column. -
Initialize a
for
loop to display the dates next to the points. Iterate over the indexes ofdata
usingindex
as the dummy variable. -
Within the loop, use the
.text()
method ofplt
to display text on the plot. The method should have 4 parameters:- the first is responsible for the x-coordinate of the text, which should be the
index
value of the'Temperature'
column with a0.2
offset; - the second is responsible for the y-coordinate of text, which should be the
index
value of the'Weekly_Sales'
column; - the third is the text that should be displayed which should be the
index
value of the'Date'
column, transformed into a date; - the fourth is the
color
parameter, responsible for color of the text, which should be'black'
.
- the first is responsible for the x-coordinate of the text, which should be the
Thanks for your feedback!
Or is it Holiday Effect?
Let's find out if holidays could be the cause. To do this, we will display the dates next to the points.
Swipe to show code editor
-
Add a
hue
parameter to the.scatterplot()
function so that the points will be colored in accordance to the values in the'Holiday_Flag'
column. -
Initialize a
for
loop to display the dates next to the points. Iterate over the indexes ofdata
usingindex
as the dummy variable. -
Within the loop, use the
.text()
method ofplt
to display text on the plot. The method should have 4 parameters:- the first is responsible for the x-coordinate of the text, which should be the
index
value of the'Temperature'
column with a0.2
offset; - the second is responsible for the y-coordinate of text, which should be the
index
value of the'Weekly_Sales'
column; - the third is the text that should be displayed which should be the
index
value of the'Date'
column, transformed into a date; - the fourth is the
color
parameter, responsible for color of the text, which should be'black'
.
- the first is responsible for the x-coordinate of the text, which should be the
Thanks for your feedback!
Or is it Holiday Effect?
Let's find out if holidays could be the cause. To do this, we will display the dates next to the points.
Swipe to show code editor
-
Add a
hue
parameter to the.scatterplot()
function so that the points will be colored in accordance to the values in the'Holiday_Flag'
column. -
Initialize a
for
loop to display the dates next to the points. Iterate over the indexes ofdata
usingindex
as the dummy variable. -
Within the loop, use the
.text()
method ofplt
to display text on the plot. The method should have 4 parameters:- the first is responsible for the x-coordinate of the text, which should be the
index
value of the'Temperature'
column with a0.2
offset; - the second is responsible for the y-coordinate of text, which should be the
index
value of the'Weekly_Sales'
column; - the third is the text that should be displayed which should be the
index
value of the'Date'
column, transformed into a date; - the fourth is the
color
parameter, responsible for color of the text, which should be'black'
.
- the first is responsible for the x-coordinate of the text, which should be the
Thanks for your feedback!
Let's find out if holidays could be the cause. To do this, we will display the dates next to the points.
Swipe to show code editor
-
Add a
hue
parameter to the.scatterplot()
function so that the points will be colored in accordance to the values in the'Holiday_Flag'
column. -
Initialize a
for
loop to display the dates next to the points. Iterate over the indexes ofdata
usingindex
as the dummy variable. -
Within the loop, use the
.text()
method ofplt
to display text on the plot. The method should have 4 parameters:- the first is responsible for the x-coordinate of the text, which should be the
index
value of the'Temperature'
column with a0.2
offset; - the second is responsible for the y-coordinate of text, which should be the
index
value of the'Weekly_Sales'
column; - the third is the text that should be displayed which should be the
index
value of the'Date'
column, transformed into a date; - the fourth is the
color
parameter, responsible for color of the text, which should be'black'
.
- the first is responsible for the x-coordinate of the text, which should be the