Chapter 1, Getting Started with pandas Using Wakari.io, walks you through usingWakari.io, an online collaborative data analytics platform, that utilizes Python,IPython Notebook, and pandas. We will start with a brief overview of Wakari.ioand step through how to upgrade the default Python environment and install allof the tools used throughout this text. At the end, you will have a fully functionalfinancial analytics platform supporting all of the examples we will cover.
Chapter 2, Introducing the Series and DataFrame, teaches you about the core pandasdata structures—the Series and the DataFrame. You will learn how a Series expandson the functionality of the NumPy array to provide much richer representation andmanipulation of sequences of data through the use of high-performance indices.You will then learn about the pandas DataFrame and how to use it to modeltwo-dimensional tabular data.
Chapter 3, Reshaping, Reorganizing, and Aggregating, focuses on how to use pandas togroup data, enabling you to perform aggregate operations on grouped data to assistwith deriving analytic results. You will learn to reorganize, group, and aggregatestock data and to use grouped data to calculate simple risk measurements.
Chapter 4, Time-series, explains how to use pandas to represent sequences of pricingdata that are indexed by the progression of time. You will learn how pandasrepresents date and time as well as concepts such as periods, frequencies, time zones,and calendars. The focus then shifts to learning how to model time-series data withpandas and to perform various operations such as shifting, lagging, resampling, andmoving window operations.
Chapter 5, Time-series Stock Data, leads you through retrieving and performingvarious financial calculations using historical stock quotes obtained from Yahoo!Finance. You will learn to retrieve quotes, perform various calculations, such aspercentage changes, cumulative returns, moving averages, and volatility, and finishwith demonstrations of several analysis techniques including return distribution,correlation, and least squares analysis.
Chapter 6, Trading Using Google Trends, demonstrates how to form correlationsbetween index data and trends in searches on Google. You will learn how to gatherindex data from Quandl along with trend data from Google and then how tocorrelate this time-series data and use that information to generate trade signals,which will be used to calculate the effectiveness of the trading strategy as comparedto the actual market performance.
Chapter 7, Algorithmic Trading, introduces you to the concepts of algorithmic tradingthrough demonstrations of several trading strategies, including simple movingaverages, exponentially weighted averages, crossovers, and pairs-trading. Youwill then learn to implement these strategies with pandas data structures and touse Zipline, an open source back-testing tool, to simulate trading behavior onhistorical data.
Chapter 8, Working with Options, teaches you to model and evaluate options. Youwill first learn briefly about options, how they function, and how to calculate theirpayoffs. You will then load options data from Yahoo! Finance into pandas datastructures and examine various options attributes, such as implied volatility andvolatility smiles and smirks. We then examine the pricing of options with BlackScholes using Mibian and finish with an overview of Greeks and how to calculatethem using Mibian.
Chapter 9, Portfolios and Risk, will teach you how to model portfolios of multiplestocks using pandas. You will learn about the concepts of Modern Portfolio Theoryand how to apply those theories with pandas and Python to calculate the risk andreturns of a portfolio, assign different weights to different instruments in a portfolio,derive the Sharpe ratio, calculate efficient frontiers and value at risk, and optimizeportfolio instrument allocation.