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 start coding
-
Add a
hueparameter to the.scatterplot()function so that the points will be colored in accordance to the values in the'Holiday_Flag'column. -
Initialize a
forloop to display the dates next to the points. Iterate over the indexes ofdatausingindexas the dummy variable. -
Within the loop, use the
.text()method ofpltto 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
indexvalue of the'Temperature'column with a0.2offset; - the second is responsible for the y-coordinate of text, which should be the
indexvalue of the'Weekly_Sales'column; - the third is the text that should be displayed which should be the
indexvalue of the'Date'column, transformed into a date; - the fourth is the
colorparameter, 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
Рішення
Дякуємо за ваш відгук!
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Сумаризуйте цей розділ
Пояснити код у file
Пояснити, чому file не вирішує завдання
Awesome!
Completion rate improved to 3.45
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 start coding
-
Add a
hueparameter to the.scatterplot()function so that the points will be colored in accordance to the values in the'Holiday_Flag'column. -
Initialize a
forloop to display the dates next to the points. Iterate over the indexes ofdatausingindexas the dummy variable. -
Within the loop, use the
.text()method ofpltto 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
indexvalue of the'Temperature'column with a0.2offset; - the second is responsible for the y-coordinate of text, which should be the
indexvalue of the'Weekly_Sales'column; - the third is the text that should be displayed which should be the
indexvalue of the'Date'column, transformed into a date; - the fourth is the
colorparameter, 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
Рішення
Дякуємо за ваш відгук!
single