In this short article, I’ll show you how to calculate moving averages (MA) using the Python library Pandas and then plot the resulting data using the Matplotlib library.
This type of moving average is also commonly known as a Simple Moving Average (SMA). A less used terminology is Rolling Average.
First, we need to import some data to work with. I’m using this article's approach to extract Amazon (AMZN) stock data from Yahoo Finance. This data is saved to our local machine as a CSV file. Once we have this CSV file, we are ready to use it.
The reason for writing this is that I was looking around for a simple straightforward solution, but I didn’t find any that worked.
The code that you’ll find below is a synthesis of the code found in the articles , …
This article is a continuation of my previous article called “Downloading and exploring the Finra Margin Debt statistics using Scrapy and Pandas.”
Here we will be looking at the yearly changes in the Debit Balances and see how these relate to the recent recessions in the U.S. economy.
Let’s recall what we have from the previous article. As seen before, you can check the first 5 entries in the Pandas DataFrame with head().
On the Finra website, you can find the data for the U.S. margin debt. Margin debt reflects the amount of cash investors have borrowed from their brokers against their investment portfolios.
The monthly margin debt can be interesting to study to assess whether the stock market is moving into bubble territory.
In case you are looking to improve your Digital Marketing skills, let me tell you how I found a way to do just that.
I had been looking to improve my skills in digital marketing for a while.
On YouTube, I’d watch video after video on various topics related to digital marketing. Apart from just taking notes, I’d occasionally try out some of the things I saw demonstrated in the videos.
This led to sporadic success, but not enough to build proper skills and confidence.
Along came the global health situation. …
Some people, including certain best-selling authors, seem to claim that buying your own house is buying a liability.
I beg to differ.
Given that all humans have a non-negotiable basic need for shelter in some form or another, they will have an implicit ongoing cost to secure this shelter.
I will use the word ‘shelter’ from here on instead of ‘house,’ given that this better reflects the basic human need.
The more you move to the north in the northern hemisphere, and the more you move to the south in the southern hemisphere, the higher this cost will be due…
Here you can find a selection of the 5 best YouTube channels on Artificial Intelligence and other Computer Science topics. The channels contain videos on the latest research and interviews with researchers in these fields.
Lex Fridman is an AI researcher working on autonomous vehicles, human-robot interaction, and machine learning. He is based at MIT.
On his channels you can find interviews with important people in AI and Computer Science, like Bjarne Stroustrup, Donald Knuth, François Chollet, Brian Kernighan, David Silver, John Hopfield, Andrew Ng, but also other interesting scientists like Stephen Wolfram, Paul Krugman, Richard Dawkins, Roger Penrose and…
Would you like to know how to create a simple chart in Microsoft Excel? In that case, you are reading the right article.
First I will show you the requirements for a well-made useful chart. Like this, you’ll know exactly which elements to add to your chart. After that I’ll show you how to create a blank chart and how to fill it with your data to create line plots. After that, I will show you how to add the remaining elements like chart and axis titles to your chart. …
Are you struggling with how to calculate a moving average in Microsoft Excel? Then this article will help you step-by-step.
The specific moving average (MA) that I will discuss in this article is also commonly referred to as a Simple Moving Average (SMA) or a trailing moving average.
Mathematical formula for SMA:
It is a type of MA that is frequently used in the forecasting of data series. These data series can be anything like stock prices, temperatures, CO2 levels in the atmosphere, daily sales, etc…
If you are curious about how to import CSV data into Excel, you should read on to find out…
Disclaimer: My version of Excel is a rather old one (it’s the 2007 version), but the actual functionality or the placement of the different functions doesn’t seem to have changed that much since then. Only the graphic design of the user interface seems to have been modernized. No matter what version of Excel you have, the screenshots below should be sufficient to illustrate the process.
In order to have a CSV file to work with in this article, you can first…