万本电子书0元读

万本电子书0元读

顶部广告

Mastering pandas for Finance电子书

售       价:¥

22人正在读 | 0人评论 9.8

作       者:Michael Heydt

出  版  社:Packt Publishing

出版时间:2015-05-25

字       数:118.8万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
If you are interested in quantitative finance, financial modeling, and trading, or simply want to learn how Python and pandas can be applied to finance, then this book is ideal for you. Some knowledge of Python and pandas is assumed. Interest in financial concepts is helpful, but no prior knowledge is expected.
目录展开

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 and expected return

Diversification

The efficient frontier

Modeling a portfolio with pandas

Constructing an efficient portfolio

Gathering historical returns for a portfolio

Formulation of portfolio risks

The Sharpe ratio

Optimization and minimization

Constructing an optimal portfolio

Visualizing the efficient frontier

Value at Risk

Summary

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部