To find the city with the optimal climate, we’ll go through the following steps:
- For each city, read the time series data of temperature, humidity, wind speed, and clear/cloudy skies.
- For each city, compute the average value of each weather parameter.
- Assign scores to each city using the criteria from the previous subsection.
- Sum up the scores to find the winner.
Sounds easy, right? We covered most of the logistics around reading and processing time series data in chapters 5 and 7. Here, we’ll focus on implementing the generic average function that can operate on integer, real, or logical data.
Strategy for this exercise