Recap: Weekly Steps
Part of the Data and Plots section of Coddy's Machine Learning journey. Lesson 25 of 60.
Challenge
MediumRemember the chart that opened this chapter? Now you build it. Ana and Ben aim for 10 thousand steps a day; ana and ben hold days 1 to 7.
In the ax form, with steps in thousands up (8420 is 8.42), draw in this order:
- Ana: a purple solid line with circles.
- Ben's days at 10 or more: green dots.
- Ben's other days: red dots.
- The goal: a black dashed line from (1, 10) to (7, 10).
Yours should look like this one, from last week:
Use these exact texts: the title Weekly Steps, the labels Day and Steps (thousands), and the legend names Ana, Ben met goal, Ben missed and Goal. Your program prints nothing; Coddy describes your chart.
Try it yourself
import numpy as np
import matplotlib.pyplot as plt
days = np.arange(1, 8)
ana = np.array([8420, 11250, 9800, 12400, 7600, 10900, 13100])
ben = np.array([6200, 7400, 10100, 10000, 9500, 12000, 11300])
# Write your code below
All lessons in Data and Plots
2NumPy Arrays
Creating ArraysShape and SizeRanges of NumbersIndexing and SlicingRecap: Temperature Grid5Line and Scatter Plots
Labels and TitlesScatter PlotsSeveral Lines and LegendsColors and MarkersFigures and AxesRecap: Weekly StepsPractice on your own: Online Python compiler