Rolling statistics - p.11 Data Analysis with Python and Pandas Tutorial

Channel:
Subscribers:
1,410,000
Published on ● Video Link: https://www.youtube.com/watch?v=FRzfD1FtrsQ



Category:
Tutorial
Duration: 14:19
41,893 views
310


Welcome to another data analysis with Python and Pandas tutorial series, where we become real estate moguls. In this tutorial, we're going to be covering the application of various rolling statistics to our data in our dataframes.

One of the more popular rolling statistics is the moving average. This takes a moving window of time, and calculates the average or the mean of that time period as the current value. In our case, we have monthly data. So a 10 moving average would be the current value, plus the previous 9 months of data, averaged, and there we would have a 10 moving average of our monthly data. Doing this is Pandas is incredibly fast. Pandas comes with a few pre-made rolling statistical functions, but also has one called a rolling_apply. This allows us to write our own function that accepts window data and apply any bit of logic we want that is reasonable. This means that even if Pandas doesn't officially have a function to handle what you want, they have you covered and allow you to write exactly what you need. Let's start with a basic moving average, or a rolling_mean as Pandas calls it. You can check out all of the Moving/Rolling statistics from Pandas' documentation.

Text tutorial and sample code: http://pythonprogramming.net/rolling-statistics-data-analysis-python-pandas-tutorial/

http://pythonprogramming.net
https://twitter.com/sentdex




Other Videos By sentdex


2015-11-30Return Files with send_file - Flask Web Development with Python 30
2015-11-27Flask Mail - Flask Web Development with Python 29
2015-11-23URL Converters - Flask Web Development with Python 28
2015-11-18Jinja Templating Cont'd - Flask Web Development with Python 27
2015-11-16Includes - Flask Web Development with Python 26
2015-11-08Scikit Learn Incorporation - p.16 Data Analysis with Python and Pandas Tutorial
2015-11-03Rolling Apply and Mapping Functions - p.15 Data Analysis with Python and Pandas Tutorial
2015-10-29Adding other economic indicators - p.14 Data Analysis with Python and Pandas Tutorial
2015-10-27Joining 30 year mortgage rate - p.13 Data Analysis with Python and Pandas Tutorial
2015-10-21Applying Comparison Operators to DataFrame - p.12 Data Analysis with Python and Pandas Tutorial
2015-10-17Rolling statistics - p.11 Data Analysis with Python and Pandas Tutorial
2015-10-12Handling Missing Data - p.10 Data Analysis with Python and Pandas Tutorial
2015-10-09Resampling - p.9 Data Analysis with Python and Pandas Tutorial
2015-10-05Percent Change and Correlation Tables - p.8 Data Analysis with Python and Pandas Tutorial
2015-10-03Pickling - p.7 Data Analysis with Python and Pandas Tutorial
2015-09-29Joining and Merging Dataframes - p.6 Data Analysis with Python and Pandas Tutorial
2015-09-25Concatenating and Appending dataframes - p.5 Data Analysis with Python and Pandas Tutorial
2015-09-23Building dataset - p.4 Data Analysis with Python and Pandas Tutorial
2015-09-20IO Basics - p.3 Data Analysis with Python and Pandas Tutorial
2015-09-16Pandas Basics - p.2 Data Analysis with Python and Pandas Tutorial
2015-09-14Data Analysis with Python and Pandas Tutorial Introduction



Tags:
Pandas
Python (Programming Language)
Data Analysis (Media Genre)
Data (Website Category)
Statistics (Field Of Study)
moving average