Python Tutorial: Time Series Analysis in Python

DataCamp · Beginner ·🛠️ AI Tools & Apps ·6y ago
Want to learn more? Take the full course at https://learn.datacamp.com/courses/introduction-to-time-series-analysis-in-python at your own pace. More than a video, you'll learn hands-on coding & quickly apply skills to your daily work. --- Welcome to the first video of the "Introduction to Times Series Analysis Using Python" course. My name is Rob Reider. I'm an Adjunct Professor in the Math-Finance Master's program at NYU's Courant Institute, where I teach a course on Time Series Analysis. I'm also a consultant to a company called Quantopian, which has built a Python-based platform for analyzing and backtesting quantitative trading strategies. Authors of algorithms can enter into paper trading contests and be considered for an allocation of money. Authors receiving allocations are paid 10 percent of the strategy’s net profits, based on their strategy’s individual performance. Also, Quantopian hosts a community where members can ask for help, share ideas, and discuss and share code. Time series analysis deals with data that is ordered in time. Of course, there are many other types of data that are not covered in this course - for example, cross-sectional data that are taken at one point in time. Time series comes up in many contexts. Here is a time series of the frequency of Google searches for the word "diet" over a five year period. You can see an interesting pattern: it hits a low around the holidays and then spikes up at the beginning of the year when people make New Year's resolutions to lose weight. Here is another example of a time series: the average annual temperature in New York City since 1870. Notice that this time series is trending up. Many of the most interesting applications of time series analysis are financial time series. In this course, you will look at a variety of financial time series: stocks, bonds, commodities, even cryptocurrencies like Bitcoin. Here is the time series of quarterly earnings for the company H&R Block. H&R Block is in th

What You'll Learn

This video tutorial covers time series analysis in Python using various libraries and tools, including Pandas, to manipulate and analyze time series data.

Full Transcript

welcome to the first video of the introduction to time series analysis using Python course my name is Rob Reider I'm an adjunct professor in the math finance master's program at NYU's Courant Institute where I teach a course on time series analysis I'm also a consultant to a company called quanto peon which has built a Python based platform for analyzing and back-testing quantitative training strategies authors of algorithms can enter into paper trading contests and be considered for an allocation of money authors receiving allocations are paid 10% of the strategies net profits based on their strategies individual performance also quanto peon hosts a community where members can ask for help share ideas and discuss and share code time series analysis deals with data that is ordered in time of course there are many other types of data that are not covered in this course for example cross-sectional data that are taken at one point in time time series come up in many contexts here is a time series of the frequency of google searches for the word diet over a five-year period you can see an interesting pattern it hits a low around the holidays and then spikes up at the beginning of the year when people make new year's resolutions to lose weight here is another example of a time series the average annual temperature in New York City since 1870 notice that this time series is trending up many of the most interesting applications of time series analysis are financial time series in this course you will look at a variety of financial time series stocks bonds commodities even crypto currencies like Bitcoin here is the time series of quarterly earnings for the company H&R Block H&R Block is in the business of preparing tax returns for customers and selling tax software the vast majority of their earnings occurs in the quarter that taxes are due notice the strong seasonality pattern in the earnings you will also look at related series in the last chapter of this course here are the prices of two energy commodities heating oil and natural gas which move together in this course you will learn about various time series models fit the data to these models and use these models to make forecasts of the future you will also learn how to use various statistical packages in python to perform these tasks numerous examples will be provided and I hope that these examples not only demonstrate how to apply these tools but also address some interesting puzzles mainly in the field of finance in the course of analyzing time series data you will use several convenient pandas tools for manipulating time series data these methods will be used repeatedly throughout the course so we will highlight a few of them now to date time is used to convert an index often read in as a string into a date time index the plot method of pans is is a quick way to plot data and if the index has been converted to a daytime object you can slice the data by year for example you will sometimes need to merge or join two data frames for example one data frame may contain stock prices and another data frame may contain bond prices pandas makes it easy to resample data for example a data frame of daily data can be converted to weekly data with the resample method often you will want to convert prices to returns which you can do with the percent change method or if you want differences you can use the diff method you can compute the correlation of two series using the core method and the autocorrelation using the auto core method you'll learn more about these methods later in this chapter now let's practice using a few of these time series tools
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from DataCamp · DataCamp · 22 of 60

1 SQL Server Tutorial: Date manipulation
SQL Server Tutorial: Date manipulation
DataCamp
2 R Tutorial: Intermediate Interactive Data Visualization with plotly in R
R Tutorial: Intermediate Interactive Data Visualization with plotly in R
DataCamp
3 R Tutorial: Adding aesthetics to represent a variable
R Tutorial: Adding aesthetics to represent a variable
DataCamp
4 R Tutorial: Moving Beyond Simple Interactivity
R Tutorial: Moving Beyond Simple Interactivity
DataCamp
5 Python Tutorial: Why use ML for marketing? Strategies and use cases
Python Tutorial: Why use ML for marketing? Strategies and use cases
DataCamp
6 Python Tutorial: Preparation for modeling
Python Tutorial: Preparation for modeling
DataCamp
7 Python Tutorial: Machine Learning modeling steps
Python Tutorial: Machine Learning modeling steps
DataCamp
8 R Tutorial: The prior model
R Tutorial: The prior model
DataCamp
9 R Tutorial: Data & the likelihood
R Tutorial: Data & the likelihood
DataCamp
10 R Tutorial: The posterior model
R Tutorial: The posterior model
DataCamp
11 R Tutorial: An Introduction to plotly
R Tutorial: An Introduction to plotly
DataCamp
12 R Tutorial: Plotting a single variable
R Tutorial: Plotting a single variable
DataCamp
13 R Tutorial: Bivariate graphics
R Tutorial: Bivariate graphics
DataCamp
14 Python Tutorial: Customer Segmentation in Python
Python Tutorial: Customer Segmentation in Python
DataCamp
15 Python Tutorial: Time cohorts
Python Tutorial: Time cohorts
DataCamp
16 Python Tutorial: Calculate cohort metrics
Python Tutorial: Calculate cohort metrics
DataCamp
17 Python Tutorial: Cohort analysis visualization
Python Tutorial: Cohort analysis visualization
DataCamp
18 R Tutorial: Building Dashboards with flexdashboard
R Tutorial: Building Dashboards with flexdashboard
DataCamp
19 R Tutorial: Anatomy of a flexdashboard
R Tutorial: Anatomy of a flexdashboard
DataCamp
20 R Tutorial: Layout basics
R Tutorial: Layout basics
DataCamp
21 R Tutorial: Advanced layouts
R Tutorial: Advanced layouts
DataCamp
Python Tutorial: Time Series Analysis in Python
Python Tutorial: Time Series Analysis in Python
DataCamp
23 Python Tutorial: Correlation of Two Time Series
Python Tutorial: Correlation of Two Time Series
DataCamp
24 Python Tutorial: Simple Linear Regressions
Python Tutorial: Simple Linear Regressions
DataCamp
25 Python Tutorial: Autocorrelation
Python Tutorial: Autocorrelation
DataCamp
26 R Tutorial: The gapminder dataset
R Tutorial: The gapminder dataset
DataCamp
27 R Tutorial: The filter verb
R Tutorial: The filter verb
DataCamp
28 R Tutorial: The arrange verb
R Tutorial: The arrange verb
DataCamp
29 R Tutorial: The mutate verb
R Tutorial: The mutate verb
DataCamp
30 R Tutorial: What is cluster analysis?
R Tutorial: What is cluster analysis?
DataCamp
31 R Tutorial: Distance between two observations
R Tutorial: Distance between two observations
DataCamp
32 R Tutorial: The importance of scale
R Tutorial: The importance of scale
DataCamp
33 R Tutorial: Measuring distance for categorical data
R Tutorial: Measuring distance for categorical data
DataCamp
34 Python Tutorial: Plotting multiple graphs
Python Tutorial: Plotting multiple graphs
DataCamp
35 Python Tutorial: Customizing axes
Python Tutorial: Customizing axes
DataCamp
36 Python Tutorial: Legends, annotations, & styles
Python Tutorial: Legends, annotations, & styles
DataCamp
37 Python Tutorial: Introduction to iterators
Python Tutorial: Introduction to iterators
DataCamp
38 Python Tutorial: Playing with iterators
Python Tutorial: Playing with iterators
DataCamp
39 Python Tutorial: Using iterators to load large files into memory
Python Tutorial: Using iterators to load large files into memory
DataCamp
40 SQL Tutorial: Introduction to Relational Databases in SQL
SQL Tutorial: Introduction to Relational Databases in SQL
DataCamp
41 SQL Tutorial: Tables: At the core of every database
SQL Tutorial: Tables: At the core of every database
DataCamp
42 SQL Tutorial: Update your database as the structure changes
SQL Tutorial: Update your database as the structure changes
DataCamp
43 Python Tutorial: Classification-Tree Learning
Python Tutorial: Classification-Tree Learning
DataCamp
44 Python Tutorial: Decision-Tree for Classification
Python Tutorial: Decision-Tree for Classification
DataCamp
45 Python Tutorial: Decision-Tree for Regression
Python Tutorial: Decision-Tree for Regression
DataCamp
46 Python Tutorial: Census Subject Tables
Python Tutorial: Census Subject Tables
DataCamp
47 Python Tutorial: Census Geography
Python Tutorial: Census Geography
DataCamp
48 Python Tutorial: Using the Census API
Python Tutorial: Using the Census API
DataCamp
49 R Tutorial: A/B Testing in R
R Tutorial: A/B Testing in R
DataCamp
50 R Tutorial: Baseline Conversion Rates
R Tutorial: Baseline Conversion Rates
DataCamp
51 R Tutorial: Designing an Experiment - Power Analysis
R Tutorial: Designing an Experiment - Power Analysis
DataCamp
52 R Tutorial: Introduction to qualitative data
R Tutorial: Introduction to qualitative data
DataCamp
53 R Tutorial: Understanding your qualitative variables
R Tutorial: Understanding your qualitative variables
DataCamp
54 R Tutorial: Making Better Plots
R Tutorial: Making Better Plots
DataCamp
55 SQL Tutorial: OLTP and OLAP
SQL Tutorial: OLTP and OLAP
DataCamp
56 SQL Tutorial: Storing data
SQL Tutorial: Storing data
DataCamp
57 SQL Tutorial: Database design
SQL Tutorial: Database design
DataCamp
58 Python Tutorial: Introduction to spaCy
Python Tutorial: Introduction to spaCy
DataCamp
59 Python Tutorial: Statistical Models
Python Tutorial: Statistical Models
DataCamp
60 Python Tutorial: Rule-based Matching
Python Tutorial: Rule-based Matching
DataCamp

This video tutorial introduces time series analysis in Python, covering various concepts and tools, including Pandas, to manipulate and analyze time series data. Viewers will learn how to apply these tools to real-world financial data and make forecasts.

Key Takeaways
  1. Import necessary libraries
  2. Load and manipulate time series data
  3. Use Pandas to convert index to datetime
  4. Plot data using Pandas
  5. Resample data using Pandas
  6. Compute returns and differences using Pandas
  7. Calculate correlation and autocorrelation using Pandas
💡 Time series analysis is a crucial technique in finance and other fields, and Python's Pandas library provides convenient tools for manipulating and analyzing time series data.

Related AI Lessons

Up next
I Asked ChatGPT to Apply to 500 Jobs (8 Interviews in 48 Hours)
Sabrina Ramonov 🍄
Watch →