Rolling Window Calculations on Excel Data - Simple Moving Average


Rolling Window Calculations on Excel Data - Simple Moving Average

*

Full Code From This Example:


YouTube Description:

Learn Python Pandas Video #6 - Using rolling windows In this video we'll cover how can use a rolling window to look at the simple moving average of bitcoin price. This is a pretty common calculation in the stock market and a handy tool that pandas has built in for us. #Python #Pandas #RollingWindows The support from you all is incredible - Thank you!! 4250+ Subscribers. You all rock, Thank you. ***************************************************************** Full code from the video: import pandas as pd excel_file = 'BTC_USD_2013-10-01_2019-07-23-CoinDesk.csv' df = pd.read_csv(excel_file) print(df.columns) print(df.head(5)) new_df = df.loc[:, "Date":"Closing Price (USD)"] print(new_df) simple_moving_average = new_df.rolling(window=7, on='Date').mean() # .min() #max() #.sum() print(simple_moving_average) https://github.com/Derrick-Sherrill/DerrickSherrill.com/blob/master/bitcoin_rolling_averages.py ***************************************************************** Code from this tutorial and all my others can be found on my GitHub: https://github.com/Derrick-Sherrill/DerrickSherrill.com Check out my website: https://www.derricksherrill.com/ If you liked the video - please hit the like button. It means more than you know. Thanks for watching and thank you for all your support!! Always looking for suggestions on what video to make next -- leave me a comment with your project! Happy Coding!

Enjoy this content? Consider Subbing to the Youtube channel





Derrick Sherrill

By: Derrick Sherrill

Thanks for visiting my page! I'm working hard to make the best content I can for you. I love watching people learn and teaching others. Happy Coding!

Become a Patreon!