课程: Hands-On Advanced Python: Data Engineering Basics
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Solution: Detect outliers - Python教程
课程: Hands-On Advanced Python: Data Engineering Basics
Solution: Detect outliers
- [Instructor] All right, so this challenge was a little bit of a tricky one, so let's go through it step by step. Our challenge was to find the number of days in all the winter days in the dataset that had an average temperature that was two standard deviations above the mean average temperature for all those winter days. And for the purposes of this challenge, we defined winter days as days in the months of December, January and February for all the years in the weather data. So the first step in this challenge was to narrow down the dataset to include just days in the winter months. So that's what my code here does. Let me, so I'm looking for days that are just within these months. And so I have a list comprehension here that makes sure that each one of the month strings in the winters function matches part of the date for all the days. So this is filters out all of the days that are not within the winter months. And…