Mastering pandas for Finance
eBook - ePub

Mastering pandas for Finance

Michael Heydt

Condividi libro
  1. 298 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Mastering pandas for Finance

Michael Heydt

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Mastering pandas for Finance è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Mastering pandas for Finance di Michael Heydt in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Business e Business Intelligence. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2015
ISBN
9781783985104

Mastering pandas for Finance


Table of Contents

Mastering pandas for Finance
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Started with pandas Using Wakari.io
What is Wakari?
Creating a Wakari cloud account
Updating existing packages
Installing new packages
Installing the samples in Wakari
Summary
2. Introducing the Series and DataFrame
Notebook setup
The main pandas data structures – Series and DataFrame
The Series
The DataFrame
The basics of the Series and DataFrame objects
Creating a Series and accessing elements
Size, shape, uniqueness, and counts of values
Alignment via index labels
Creating a DataFrame
Example data
Selecting columns of a DataFrame
Selecting rows of a DataFrame using the index
Slicing using the [] operator
Selecting rows by the index label and location – .loc[] and .iloc[]
Selecting rows by the index label and/or location – .ix[]
Scalar lookup by label or location using .at[] and .iat[]
Selecting rows using the Boolean selection
Arithmetic on a DataFrame
Reindexing the Series and DataFrame objects
Summary
3. Reshaping, Reorganizing, and Aggregating
Notebook setup
Loading historical stock data
Organizing the data for the examples
Reorganizing and reshaping data
Concatenating multiple DataFrame objects
Merging DataFrame objects
Pivoting
Stacking and unstacking
Melting
Grouping and aggregating
Splitting
Aggregating
Summary
4. Time-series
Notebook setup
Time-series data and the DatetimeIndex
Creating time-series with specific frequencies
Representing intervals of time using periods
Shifting and lagging time-series data
Frequency conversion of time-series data
Resampling of time-series
Summary
5. Time-series Stock Data
Notebook setup
Obtaining historical stock and index data
Fetching historical stock data from Yahoo!
Fetching index data from Yahoo!
Visualizing financial time-series data
Plotting closing prices
Plotting volume-series data
Combined price and volumes
Plotting candlesticks
Fundamental financial calculations
Calculating simple daily percentage change
Calculating simple daily cumulative returns
Analyzing the distribution of returns
Histograms
Q-Q plots
Box-and-whisker plots
Comparison of daily percentage change between stocks
Moving windows
Volatility calculation
Rolling correlation of returns
Least-squares regression of returns
Comparing stocks to the S&P 500
Summary
6. Trading Using Google Trends
Notebook setup
A brief on Quantifying Trading Behavior in Financial Markets Using Google Trends
Data collection
The data from the paper
Gathering our own DJIA data from Quandl
Google Trends data
Generating order signals
Computing returns
Cumulative returns and the result of the strategy
Summary
7. Algorithmic Trading
Notebook setup
The process of algorithmic trading
Momentum strategies
Mean-reversion strategies
Moving averages
Simple moving average
Exponentially weighted moving average
Technical analysis techniques
Crossovers
Pairs trading
Algo trading with Zipline
Algorithm – buy apple
Algorithm – dual moving average crossover
Algorithm – pairs trade
Summary
8. Working with Options
Introducing options
Notebook setup
Options data from Yahoo! Finance
Implied volatility
Volatility smirks
Calculating payoff on options
The call option payoff calculation
The put option payoff calculation
Profit and loss calculation
The call option profit and loss for a buyer
The call option profit and loss for the seller
Combined payoff charts
The put option profit and loss for a buyer
The put option profit and loss for the seller
The pricing of options
The pricing of options with Black-Scholes
Deriving the model
The value of the cash to buy
The value of the stock received
The formulas
d1 and d2
Black-Scholes using Mibian
Charting option price change over time
The Greeks
Calculation and visualization
Summary
9. Portfolios and Risk
Notebook setup
An overview of modern portfolio theory
Concept
Mathematical modeling of a portfolio
Risk...

Indice dei contenuti