Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Reading and Visualizing Data | Time Series Processing
Time Series Analysis
course content

Course Content

Time Series Analysis

Time Series Analysis

1. Time Series: Let's Start
2. Time Series Processing
3. Time Series Visualization
4. Stationary Models
5. Non-Stationary Models
6. Solve Real Problems

Reading and Visualizing Data

The first thing to start with is reading the data. When working with time series, the rules of the game do not change - you can still use pandas to get data from csv files.

In the files, let's say you have a Date column that contains dates in str type. For further time series analysis, you must turn the str type into a datetime. This is implemented using the pandas function to_datetime()

Let's take the dataset air_quality_no2_long.csv as an example:

Next, we convert the data type in the Date column from str to datetime:

You can also do this immediately when reading the dataset:

Now we can plot our dataset:

Task

Read and visualize the AirPassengers.csv dataset.

  1. Import matplotlib.pyplot as plt.
  2. Read the csv file and save it within the data variable.
  3. Convert "Month" into datetime type.
  4. Initialize a line plot with the "Month" column of data on the x-axis and "#Passengers" on the y-axis.
  5. Set labels on an axis and display the plot:
  • "Month" on the x-axis;
  • "Passengers" on the y-axis.

Task

Read and visualize the AirPassengers.csv dataset.

  1. Import matplotlib.pyplot as plt.
  2. Read the csv file and save it within the data variable.
  3. Convert "Month" into datetime type.
  4. Initialize a line plot with the "Month" column of data on the x-axis and "#Passengers" on the y-axis.
  5. Set labels on an axis and display the plot:
  • "Month" on the x-axis;
  • "Passengers" on the y-axis.

Switch to desktop for real-world practiceContinue from where you are using one of the options below

Everything was clear?

Section 2. Chapter 1
toggle bottom row

Reading and Visualizing Data

The first thing to start with is reading the data. When working with time series, the rules of the game do not change - you can still use pandas to get data from csv files.

In the files, let's say you have a Date column that contains dates in str type. For further time series analysis, you must turn the str type into a datetime. This is implemented using the pandas function to_datetime()

Let's take the dataset air_quality_no2_long.csv as an example:

Next, we convert the data type in the Date column from str to datetime:

You can also do this immediately when reading the dataset:

Now we can plot our dataset:

Task

Read and visualize the AirPassengers.csv dataset.

  1. Import matplotlib.pyplot as plt.
  2. Read the csv file and save it within the data variable.
  3. Convert "Month" into datetime type.
  4. Initialize a line plot with the "Month" column of data on the x-axis and "#Passengers" on the y-axis.
  5. Set labels on an axis and display the plot:
  • "Month" on the x-axis;
  • "Passengers" on the y-axis.

Task

Read and visualize the AirPassengers.csv dataset.

  1. Import matplotlib.pyplot as plt.
  2. Read the csv file and save it within the data variable.
  3. Convert "Month" into datetime type.
  4. Initialize a line plot with the "Month" column of data on the x-axis and "#Passengers" on the y-axis.
  5. Set labels on an axis and display the plot:
  • "Month" on the x-axis;
  • "Passengers" on the y-axis.

Switch to desktop for real-world practiceContinue from where you are using one of the options below

Everything was clear?

Section 2. Chapter 1
toggle bottom row

Reading and Visualizing Data

The first thing to start with is reading the data. When working with time series, the rules of the game do not change - you can still use pandas to get data from csv files.

In the files, let's say you have a Date column that contains dates in str type. For further time series analysis, you must turn the str type into a datetime. This is implemented using the pandas function to_datetime()

Let's take the dataset air_quality_no2_long.csv as an example:

Next, we convert the data type in the Date column from str to datetime:

You can also do this immediately when reading the dataset:

Now we can plot our dataset:

Task

Read and visualize the AirPassengers.csv dataset.

  1. Import matplotlib.pyplot as plt.
  2. Read the csv file and save it within the data variable.
  3. Convert "Month" into datetime type.
  4. Initialize a line plot with the "Month" column of data on the x-axis and "#Passengers" on the y-axis.
  5. Set labels on an axis and display the plot:
  • "Month" on the x-axis;
  • "Passengers" on the y-axis.

Task

Read and visualize the AirPassengers.csv dataset.

  1. Import matplotlib.pyplot as plt.
  2. Read the csv file and save it within the data variable.
  3. Convert "Month" into datetime type.
  4. Initialize a line plot with the "Month" column of data on the x-axis and "#Passengers" on the y-axis.
  5. Set labels on an axis and display the plot:
  • "Month" on the x-axis;
  • "Passengers" on the y-axis.

Switch to desktop for real-world practiceContinue from where you are using one of the options below

Everything was clear?

The first thing to start with is reading the data. When working with time series, the rules of the game do not change - you can still use pandas to get data from csv files.

In the files, let's say you have a Date column that contains dates in str type. For further time series analysis, you must turn the str type into a datetime. This is implemented using the pandas function to_datetime()

Let's take the dataset air_quality_no2_long.csv as an example:

Next, we convert the data type in the Date column from str to datetime:

You can also do this immediately when reading the dataset:

Now we can plot our dataset:

Task

Read and visualize the AirPassengers.csv dataset.

  1. Import matplotlib.pyplot as plt.
  2. Read the csv file and save it within the data variable.
  3. Convert "Month" into datetime type.
  4. Initialize a line plot with the "Month" column of data on the x-axis and "#Passengers" on the y-axis.
  5. Set labels on an axis and display the plot:
  • "Month" on the x-axis;
  • "Passengers" on the y-axis.

Switch to desktop for real-world practiceContinue from where you are using one of the options below
Section 2. Chapter 1
Switch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt