Top Banner
xlwings: Python & Excel For Python Quants Conference New York City May 6 th , 2016 Felix Zumstein
19

For Python Quants Conference NYC 6th May 2016

Apr 11, 2017

Download

Data & Analytics

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: For Python Quants Conference NYC 6th May 2016

xlwings: Python & Excel• For Python Quants Conference

• New York City

May 6th, 2016 Felix Zumstein

Page 2: For Python Quants Conference NYC 6th May 2016

Material

• For the material presented during the demos (Part 1 &3), see:https://github.com/ZoomerAnalytics/xlwings_notebooks/tree/master/for_python_quants_conference_nyc_20160506

2

Page 3: For Python Quants Conference NYC 6th May 2016

About me

• Consultancy (Zurich):

– Analytical apps for Excel & web

– Open-source: xlwings

• Previously:

– 9yrs in Banking /Asset Management

– Background: Finance & Economics

3

Page 4: For Python Quants Conference NYC 6th May 2016

The open-source Python/Excel Landscape

4

Reading/Writing

Programming/ Interacting

Page 5: For Python Quants Conference NYC 6th May 2016

xlwings Features

5

Scripting/Interaction

Macros

User Defined Functions (UDFs)

1

2

3

Page 6: For Python Quants Conference NYC 6th May 2016

1 Scripting/Interaction

Page 7: For Python Quants Conference NYC 6th May 2016

GDP per capita

7

Source of xls file:http://data.worldbank.org/indicator/NY.GDP.PCAP.CD

+

Page 8: For Python Quants Conference NYC 6th May 2016

2 Macros

Page 9: For Python Quants Conference NYC 6th May 2016

Monte Carlo Simulation

9

simulation.py

xlwings_app.py web_app.py

Source Code: https://github.com/ZoomerAnalytics/simulation-demoHosted Sample: www.zoomeranalytics.com/simulation-demo

Page 10: For Python Quants Conference NYC 6th May 2016

3 UDFs

Page 11: For Python Quants Conference NYC 6th May 2016

DJIA: Correlation Analysis

11

=CORREL(array1, array2)

Excel’s Correlation formula accepts just 2 data sets:

Here’s how we’re going to fix this:

• Add CORREL2 to get the full correlation matrix• Visual representation: Heatmap

Page 12: For Python Quants Conference NYC 6th May 2016

Summary

Page 13: For Python Quants Conference NYC 6th May 2016

(1) Easy Installation

13

• pip/conda install xlwings• included in:

Page 14: For Python Quants Conference NYC 6th May 2016

(2) Cross-Platform

14

+(except UDFs)

Page 15: For Python Quants Conference NYC 6th May 2016

(3) Flexibility

15

Version

2.62.73.33.43.5

32-bit64-bit

32-bit64-bit

200320102011 (Mac)20132016 (Win + Mac)

ArchitectureVersion Architecture

Page 16: For Python Quants Conference NYC 6th May 2016

(4) Simplicity

16

>>>  from xlwings import Workbook,  Range

>>>  wb =  Workbook()>>>  Range("A1").value  =  my_variable

• Strings• Numbers• DateTime• Lists (nested)• NumPy arrays• Pandas DataFrames

Page 17: For Python Quants Conference NYC 6th May 2016

(5) Powerful built-in Converters/Options

17

Range("A1").options(pd.DataFrame).value

@[email protected]("x",  pd.DataFrame)def myfunction(x):

return x

Page 18: For Python Quants Conference NYC 6th May 2016

(6) Prototype analytical web apps

18

vs.

Page 19: For Python Quants Conference NYC 6th May 2016

Questions?