From the course: Advanced Analytics Engineering: Real-World Practice
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Solution: Create tests for data with Python
From the course: Advanced Analytics Engineering: Real-World Practice
Solution: Create tests for data with Python
(upbeat music) - [Instructor] All right. Here's our solution to this assessment. We use the JSON library. We create a function called get_cold_windy_rainy_days. In that, we then reference our JSON file that has our data. Within that function, we create another one called is_cold_windy_rainy_day, where we create two columns: average temp, which takes the temperature, maximum temperature, minimum, and divides it by two. Then we get the total precipitation by adding snow to precipitation. We use an if statement there to create a Boolean condition, returning true or false. And then lastly, we define blustery_days and return it. If you got this right, great job. If you didn't get it right, that's okay. Keep practicing, you'll get it eventually.
Contents
-
-
-
-
-
(Locked)
Common stumbling blocks in analytics engineering1m 19s
-
(Locked)
Working with JSON files and fields7m 2s
-
(Locked)
XMLs and their uses5m 58s
-
(Locked)
Time series data7m 53s
-
(Locked)
Dealing with missing data in SQL13m 11s
-
(Locked)
Solution: Create tests for data with Python48s
-
(Locked)
Solution: Create tests for data with SQL48s
-
(Locked)
-
-
-
-