课程: Hands-On Advanced Python: Data Engineering Basics
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Statistical functions - Python教程
课程: Hands-On Advanced Python: Data Engineering Basics
Statistical functions
- [Instructor] The Python Standard Library includes a statistics module in which you can find a variety of functions for calculating common statistical data. And we're going to use that module in this example to determine values such as the mean, the median, and standard deviation of certain values in the dataset. So let's open up our statistics functions starting point. And you can see that I've already got some code written that creates a list of weather data only for days that occur during the summer months, June, July, and August. And I do this by looking for the appropriate month numbers in the date string for each item in the dataset, right? So I'm only limiting my data to summer months. And you can also see that I've imported the statistics module up here at the top of my code. So before we do anything else, okay, let's run what we have. And you can see on line 14 right here, I've got a print statement that will print out…