From the course: Python Data Analysis
Unlock the full course today
Join today to access over 24,500 courses taught by industry experts.
Solution: Temperature anomaly - Python Tutorial
From the course: Python Data Analysis
Solution: Temperature anomaly
- [Instructor] We need to compute the temperature anomaly in New York for all years in the dataset. The anomaly is defined from averages along a year, so I'll be using NumPy mean along the second axis, which has length 365. In fact, I need another mean between the minimum and the maximum. Next, I need my reference, which is the mean between 1945 and 1955. We are told that these are rows 65 to 75, and I don't need the access keyword since we're averaging over everything. Then I round and return. Oh, I actually need to subtract this reference mean from my result first. Let's test. Perfect.