Manipulating Financial Data in Python

From Quantitative Analysis Software Courses
Jump to navigation Jump to search

Module 1: Reading, Slicing and Plotting Stock Data

  • Overview of data we'll be working with: AAPL.csv, SPY.csv (note date order)
    • Meaning of various columns
  • The Pandas dataframe
  • Read CSV into a dataframe (AAPL example)
  • Slice according to dates
  • [quiz: read SPY.csv and slice against different dates]
  • Plot (note date order wrong)
  • Sort
  • Plot

Module 2: Building and plotting a dataframe with lots of stocks

  • Overview of what we want to end up with: Rows: Dates, Columns: Symbols
  • Step by step how to build it
  • SPY.csv will be our reference -- it trades every day the market is open.
  • Read SPY.csv, slice to date range, sort
  • Read AAPL.csv, merge() into existing dataframe
  • Repeat with GLD, IBM, GOOG
  • Plot and display legend
  • Observe: Scale not good, let's normalize
  • Print some of the numbers
  • Plot after normalization
  • [quiz: normalize at a different date]

Module 3: Numpy Fundamentals

  • Creating Arrays
    • empty, zeros, ones
  • Basic Indexing and Slicing (start at 0 not 1)
  • [quiz: print 2nd & 3rd columns]
  • Index one array by another
  • Reshaping
  • Data Processing using Arrays
    • Sum rows, Sum columns
    • Statistics on columns: Mean, Median, stddev
  • See: http://wiki.quantsoftware.org/index.php?title=Numpy_Tutorial_1

Module 2: Pandas DS- Series

  • Working with index
  • Operations
  • Filtering
  • Handling Incomplete Data

Module 3: Pandas DS- Data Frame

  • Creating Data frame
  • Operations
  • Columns and rows
  • Essential Function
  • Reindexing
  • Indexing and Filtering

Module 4: Data Analysis- Reading/Writing Data

  • Importing Data using Pandas
  • Importing data without pandas
  • Saving and exporting data using pandas
  • Saving and exporting data without pandas

Module 5

  • Pre-processing Data
  • Statistical Functions for Analysis

Module 6: Date And Time

  • Creating Date and Time
  • Date Mathematics
  • Time Series Plotting

Module 7: Graphs Part I

Module 8: Graphs Part II