Identifying missing values in time series data
Identifying missing values in time series data is somewhat like identifying missing values in other types of data, but there are specific considerations due to the temporal nature of time series. Since we covered some of these techniques in Chapter 8, Detecting and Handling Missing Values and Outliers, let’s summarize them here and highlight their specific adaptations for analyzing time series data using a stock market analysis use case.
Let’s consider a use case where we have daily stock prices (open, high, low, and close) for a particular company over several years. Our goal is to identify missing data in this time series to ensure the integrity of the dataset. You can find the code for this example here: https://github.com/PacktPublishing/Python-Data-Cleaning-and-Preparation-Best-Practices/blob/main/chapter11/3.missing_values/1.identify_missing_values.py.
Let’s start by generating the data:
- First,...