January 2017
Beginner to intermediate
446 pages
8h 46m
English
Now that we know how to handle time-series data, let's see how we can slice it. The process of slicing refers to dividing the data into various sub-intervals and extracting relevant information. This is very useful when you are working with time-series datasets. Instead of using indices, we will use timestamp to slice our data.
Create a new Python file and import the following packages:
import numpy as np import matplotlib.pyplot as plt import pandas as pd from timeseries import read_data
Load the third column (zero-indexed) from the input data file:
# Load input data
index = 2
data = read_data('data_2D.txt', index)
Define the start and end years, and then plot the data with year-level granularity:
# Plot data with year-level ...
Read now
Unlock full access