Time Series Forecasting in Python

Moez Ali
7 min readJun 18, 2022

Introduction to Time Series Forecasting in Python

Photo by KOBU Agency on Unsplash

Introduction

Time series data is data gathered on the same subject over time, such as a country’s annual GDP, a stock price of a company over time, or your own heartbeat recorded at each second. In fact, anything that you can capture continuously at different time intervals is a time series data.

The chart below shows the daily stock price of Tesla Inc. (Ticker Symbol: TSLA) for the past year as an example of time series data. The value in US$ is shown by the y-axis on the right-hand side (the last point on the chart, $701.91, represents the current stock price as of the writing of this article on April 12, 2021).

Example of Time Series Data — Tesla Inc. (ticker symbol: TSLA) daily stock price 1Y interval.

Cross-sectional data, on the other hand, refers to datasets that hold information at a single moment in time, such as customer information, product information, company information, and so on.

An example of a dataset that records America’s best-selling electric automobiles in the first half of 2020 may be seen below. Rather than monitoring the number of automobiles sold over time, the graphic below compares the sales of different cars such as Tesla…

--

--