NumPy comes with built-in functions for common mathematical, statistical, and aggregate functions.
import numpy as np
create 4 lists of tempratures
week_1 = [45, 55, 49, 60, 52, 55, 58]
week_2 = [51, 49, 62, 50, 53, 56, 59]
week_3 = [60, 60, 61, 62, 57, 59, 58]
week_4 = [59, 63, 62, 61, 65, 66, 62]
# use numpy mean function
np.mean(week_1)
53.42857142857143
# use numpy median function
np.median(week_1)
55.0
# Mode with Python statistics' mode()
from statistics import mode
mode(week_1)
55