-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweather.py
More file actions
104 lines (76 loc) · 2.58 KB
/
weather.py
File metadata and controls
104 lines (76 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import csv
from datetime import datetime
DEGREE_SYMBOL = u"\N{DEGREE SIGN}C"
def format_temperature(temp):
"""Takes a temperature and returns it in string format with the degrees
and Celcius symbols.
Args:
temp: A string representing a temperature.
Returns:
A string contain the temperature and "degrees Celcius."
"""
return f"{temp}{DEGREE_SYMBOL}"
def convert_date(iso_string):
"""Converts and ISO formatted date into a human-readable format.
Args:
iso_string: An ISO date string.
Returns:
A date formatted like: Weekday Date Month Year e.g. Tuesday 06 July 2021
"""
pass
def convert_f_to_c(temp_in_fahrenheit):
"""Converts a temperature from Fahrenheit to Celcius.
Args:
temp_in_fahrenheit: float representing a temperature.
Returns:
A float representing a temperature in degrees Celcius, rounded to 1 decimal place.
"""
pass
def calculate_mean(weather_data):
"""Calculates the mean value from a list of numbers.
Args:
weather_data: a list of numbers.
Returns:
A float representing the mean value.
"""
pass
def load_data_from_csv(csv_file):
"""Reads a csv file and stores the data in a list.
Args:
csv_file: a string representing the file path to a csv file.
Returns:
A list of lists, where each sublist is a (non-empty) line in the csv file.
"""
pass
def find_min(weather_data):
"""Calculates the minimum value in a list of numbers.
Args:
weather_data: A list of numbers.
Returns:
The minimum value and it's position in the list. (In case of multiple matches, return the index of the *last* example in the list.)
"""
pass
def find_max(weather_data):
"""Calculates the maximum value in a list of numbers.
Args:
weather_data: A list of numbers.
Returns:
The maximum value and it's position in the list. (In case of multiple matches, return the index of the *last* example in the list.)
"""
pass
def generate_summary(weather_data):
"""Outputs a summary for the given weather data.
Args:
weather_data: A list of lists, where each sublist represents a day of weather data.
Returns:
A string containing the summary information.
"""
pass
def generate_daily_summary(weather_data):
"""Outputs a daily summary for the given weather data.
Args:
weather_data: A list of lists, where each sublist represents a day of weather data.
Returns:
A string containing the summary information.
"""
pass