Let's see how we can extract statistics from time series data:
- Create a new Python file and import the following packages (the full code is given in the extract_stats.py file that is provided for you):
import pandas as pd import matplotlib.pyplot as plt from convert_to_timeseries import convert_data_to_timeseries
The convert_to_timeseries function is the function we defined in the previous recipe, Transforming data into a time series format, that read an input file and converted sequential observations into time-indexed data.
- We will use the same text file that we used in the previous recipes for analysis (data_timeseries.txt):
# Input file containing data input_file = 'data_timeseries.txt'
- Load both the data columns ...