Introduction to the Course

Time Series Analysis in Python

Rob Reider

Adjunct Professor, NYU-Courant Consultant, Quantopian

Example of Time Series: Google Trends

Time Series Analysis in Python

Example of Time Series: Climate Data

Time Series Analysis in Python

Example of Time Series: Quarterly Earnings Data

Time Series Analysis in Python

Example of Multiple Series: Natural Gas and Heating Oil

Time Series Analysis in Python

Goals of Course

  • Learn about time series models
  • Fit data to a time series model
  • Use the models to make forecasts of the future
  • Learn how to use the relevant statistical packages in Python
  • Provide concrete examples of how these models are used
Time Series Analysis in Python

Some Useful Pandas Tools

  • Changing an index to datetime
      df.index = pd.to_datetime(df.index)
    
  • Plotting data
      df.plot()
    
  • Slicing data
      df['2012']
    
Time Series Analysis in Python

Some Useful Pandas Tools

  • Join two DataFrames
      df1.join(df2)
    
  • Resample data (e.g. from daily to weekly)
      df = df.resample(rule='W').last()
    
Time Series Analysis in Python

More pandas Functions

  • Computing percent changes and differences of a time series
      df['col'].pct_change()
      df['col'].diff()
    
  • pandas correlation method of Series
      df['ABC'].corr(df['XYZ'])
    
  • pandas autocorrelation
      df['ABC'].autocorr()
    
Time Series Analysis in Python

Let's practice!

Time Series Analysis in Python

Preparing Video For Download...