SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
Python and Excel
in Finance
Felix Zumstein, 28 October 2019
PyData Meetup, Zürich
Agenda
1. Introduction
2. Spreadsheets in the age of blockchain
and AI
3. Demo: Excel and Python with xlwings
2
1. Introduction
Innovative Solutions
for Microsoft Excel
A small team with a big mission
4
xlwings
• Python for Excel
• Scripts, UDFs,
Macros, REST API
• Windows & Mac
• Free & open-source
• Professional support plans
5
xltrail
• Version control for
Excel
• Tracks formulas and
VBA code
6
2. Spreadsheets in the age
of blockchain and AI
2019 State of Data Science
8
Career advice in 2019
9
Marks and Spencer 2016 Q1 report
Source: https://www.ft.com/content/1fc57f26-4467-11e6-9b66-0712b3873ae1 (7/7/2016) 10
The London Whale
Source: https://www.bloomberg.com/quicktake/the-london-whale (2/23/2016) 11
Look familiar? Part I
12
=OFFSET('Appendix 4 -
Odds'!$B$3,ROW(INDEX('Appendix 4 -
Odds'!$B$3:$AH$35,MATCH(I12,'Appendix 4 -
Odds'!$B$3:$B$35,0),1))-
3,COLUMN(INDEX('Appendix 4 -
Odds'!$B$3:$AH$35,,MATCH(I13,'Appendix 4 -
Odds'!$B$3:$AH$3,0),1))-2)+INDEX('Round Robin
Predictions'!$C$4:$O$36,MATCH(I12, 'Round
Robin Predictions'!$D$4:$D$36,0),3)-
INDEX('Round Robin
Predictions'!$C$4:$O$36,MATCH(I13, 'Round
Robin Predictions'!$D$4:$D$36,0),3)
Source: https://techcommunity.microsoft.com/t5/Excel-Blog/How-We-Built-our-Soccer-Tournament-Predictor-in-Excel/ba-p/199802
Look familiar? Part II
13
We need better tools
14
Our interpretation
1) Excel = code, so treat it as such!
2) Migrating away from Excel is not
always possible.
15
3. Demo
xlwings
17
1. Interactive use with Jupyter notebook
2. xlwings workflow: Automated tests
3. UDF: Correlation matrix
4.Reporting
5. Macro: Monte Carlo simulation
6.REST API
1. Interactive: Jupyter notebook
18
2.a The xlwings workflow
• No copy/paste errors! Work
smarter through automation
• Reduce errors by getting rid of
complex formulas
• Make collaboration easy through
proper version control (no emails!)
• Peer review changes
• Spot errors before they bite
• Don’t trust humans!
Run automated tests
• Know which workbook is
the latest one
• Release and deploy your
workbook automatically
1 - Automate
2 – Collaborate 3 - Test
4 - Release
19
2.b Automated testing
20
def test_cash_flow_formula_integrity(book):
sheet = book.sheets[0]
sheet['B2'].value = 100
sheet['B3:M3'].value = 10
sheet['B4:M4'].value = -5
assert sheet['M5'].value == 160
2.c Automated testing
21
3. UDF: Correlation matrix
22
4. Reporting: xlwings-reports
23
Template Report
create_report(
”template.xlsx”,
performance=df
)
5. Macro: Monte Carlo simulation
24
6. REST API
25
Run the xlwings REST API server:
$ xlwings restapi run
Issue a GET request, e.g:
http://127.0.0.1:5000/book/timeseries.xlsx/sheets/0/range
Thank You
Let’s connect:
https://www.linkedin.com/in/felix-zumstein

Contenu connexe

Similaire à Python and Excel in Finance (PyData meetup Zurich)

Similaire à Python and Excel in Finance (PyData meetup Zurich) (20)

December 2014 marketing community meeting
December 2014 marketing community meetingDecember 2014 marketing community meeting
December 2014 marketing community meeting
 
OpenStack Foundation 2H 2015 Marketing Plan
OpenStack Foundation 2H 2015 Marketing PlanOpenStack Foundation 2H 2015 Marketing Plan
OpenStack Foundation 2H 2015 Marketing Plan
 
What's new in spark 2.0?
What's new in spark 2.0?What's new in spark 2.0?
What's new in spark 2.0?
 
Delivering Agile Data Science on Openshift - Red Hat Summit 2019
Delivering Agile Data Science on Openshift  - Red Hat Summit 2019Delivering Agile Data Science on Openshift  - Red Hat Summit 2019
Delivering Agile Data Science on Openshift - Red Hat Summit 2019
 
SC4 Workshop 2: Soren Auer BDE project Overview
SC4 Workshop 2: Soren Auer BDE project OverviewSC4 Workshop 2: Soren Auer BDE project Overview
SC4 Workshop 2: Soren Auer BDE project Overview
 
Cortex/Syntex : Digitalize your company information -aOS South Asia 24/10/2020
 Cortex/Syntex : Digitalize your company information -aOS South Asia 24/10/2020 Cortex/Syntex : Digitalize your company information -aOS South Asia 24/10/2020
Cortex/Syntex : Digitalize your company information -aOS South Asia 24/10/2020
 
Overview of Apache Flink: the 4G of Big Data Analytics Frameworks
Overview of Apache Flink: the 4G of Big Data Analytics FrameworksOverview of Apache Flink: the 4G of Big Data Analytics Frameworks
Overview of Apache Flink: the 4G of Big Data Analytics Frameworks
 
Overview of Apache Fink: the 4 G of Big Data Analytics Frameworks
Overview of Apache Fink: the 4 G of Big Data Analytics FrameworksOverview of Apache Fink: the 4 G of Big Data Analytics Frameworks
Overview of Apache Fink: the 4 G of Big Data Analytics Frameworks
 
Overview of Apache Fink: The 4G of Big Data Analytics Frameworks
Overview of Apache Fink: The 4G of Big Data Analytics FrameworksOverview of Apache Fink: The 4G of Big Data Analytics Frameworks
Overview of Apache Fink: The 4G of Big Data Analytics Frameworks
 
BDE SC6-ws-05/12/2016 technology part - SWC
BDE SC6-ws-05/12/2016 technology part - SWCBDE SC6-ws-05/12/2016 technology part - SWC
BDE SC6-ws-05/12/2016 technology part - SWC
 
Python in the Financial Industry The universal tool for end-to-end developme...
Python in the Financial Industry  The universal tool for end-to-end developme...Python in the Financial Industry  The universal tool for end-to-end developme...
Python in the Financial Industry The universal tool for end-to-end developme...
 
BDE SC6-hang out - technology part-SWC - Martin
BDE SC6-hang out - technology part-SWC - MartinBDE SC6-hang out - technology part-SWC - Martin
BDE SC6-hang out - technology part-SWC - Martin
 
¿Es posible construir el Airbus de la Supercomputación en Europa?
¿Es posible construir el Airbus de la Supercomputación en Europa?¿Es posible construir el Airbus de la Supercomputación en Europa?
¿Es posible construir el Airbus de la Supercomputación en Europa?
 
Updates from Hungary (Jozsef Kovacs)
Updates from Hungary (Jozsef Kovacs)Updates from Hungary (Jozsef Kovacs)
Updates from Hungary (Jozsef Kovacs)
 
Startup Europe: achievements and outsight
Startup Europe: achievements and outsightStartup Europe: achievements and outsight
Startup Europe: achievements and outsight
 
Seven Ways to Boost Artificial Intelligence Research
Seven Ways to Boost Artificial Intelligence ResearchSeven Ways to Boost Artificial Intelligence Research
Seven Ways to Boost Artificial Intelligence Research
 
OpenStack August 2014 Marketing Meeting
OpenStack August 2014 Marketing MeetingOpenStack August 2014 Marketing Meeting
OpenStack August 2014 Marketing Meeting
 
PechaKucha (FormaliSE'2018)
PechaKucha (FormaliSE'2018)PechaKucha (FormaliSE'2018)
PechaKucha (FormaliSE'2018)
 
Current state of industrial IoT / Industrie 4.0 markets - IoT Tech Expo
Current state of industrial IoT / Industrie 4.0 markets - IoT Tech ExpoCurrent state of industrial IoT / Industrie 4.0 markets - IoT Tech Expo
Current state of industrial IoT / Industrie 4.0 markets - IoT Tech Expo
 
Current state of industrial IoT / Industrie 4.0 markets - IoT Tech Expo
Current state of industrial IoT / Industrie 4.0 markets - IoT Tech ExpoCurrent state of industrial IoT / Industrie 4.0 markets - IoT Tech Expo
Current state of industrial IoT / Industrie 4.0 markets - IoT Tech Expo
 

Plus de xlwings

Open Source in Quant Finance - xlwings
Open Source in Quant Finance - xlwingsOpen Source in Quant Finance - xlwings
Open Source in Quant Finance - xlwings
xlwings
 

Plus de xlwings (18)

xlwings for Google Sheets
xlwings for Google Sheetsxlwings for Google Sheets
xlwings for Google Sheets
 
Cross-platform Spreadsheet Automation with Python
Cross-platform Spreadsheet Automation with PythonCross-platform Spreadsheet Automation with Python
Cross-platform Spreadsheet Automation with Python
 
Automate your PDF factsheets with xlwings Reports
Automate your PDF factsheets with xlwings ReportsAutomate your PDF factsheets with xlwings Reports
Automate your PDF factsheets with xlwings Reports
 
xlwings performance
xlwings performancexlwings performance
xlwings performance
 
Git for Excel (Webinar)
Git for Excel (Webinar)Git for Excel (Webinar)
Git for Excel (Webinar)
 
Deployment of xlwings-powered spreadsheets (webinar)
Deployment of xlwings-powered spreadsheets (webinar)Deployment of xlwings-powered spreadsheets (webinar)
Deployment of xlwings-powered spreadsheets (webinar)
 
xlwings reports: Reporting with Excel & Python
xlwings reports: Reporting with Excel & Pythonxlwings reports: Reporting with Excel & Python
xlwings reports: Reporting with Excel & Python
 
Automated testing of Excel Workbooks
Automated testing of Excel WorkbooksAutomated testing of Excel Workbooks
Automated testing of Excel Workbooks
 
Git for Excel
Git for ExcelGit for Excel
Git for Excel
 
Automated Testing of Excel Workbooks
Automated Testing of Excel WorkbooksAutomated Testing of Excel Workbooks
Automated Testing of Excel Workbooks
 
Git for Excel files webinar
Git for Excel files webinarGit for Excel files webinar
Git for Excel files webinar
 
xlwings Presentation (Excel & Python) Swiss FinteCH event
xlwings Presentation (Excel & Python) Swiss FinteCH eventxlwings Presentation (Excel & Python) Swiss FinteCH event
xlwings Presentation (Excel & Python) Swiss FinteCH event
 
Python. Finance. Excel. - The Thalesians
Python. Finance. Excel. - The ThalesiansPython. Finance. Excel. - The Thalesians
Python. Finance. Excel. - The Thalesians
 
Open Source in Quant Finance - xlwings
Open Source in Quant Finance - xlwingsOpen Source in Quant Finance - xlwings
Open Source in Quant Finance - xlwings
 
Odsc presentation
Odsc presentationOdsc presentation
Odsc presentation
 
xlwings - For Python Quants Conference (London 2014)
xlwings - For Python Quants Conference (London 2014)xlwings - For Python Quants Conference (London 2014)
xlwings - For Python Quants Conference (London 2014)
 
xlwings Zurich Python User Group Meetup
xlwings Zurich Python User Group Meetupxlwings Zurich Python User Group Meetup
xlwings Zurich Python User Group Meetup
 
xlwings - Connecting Python with Excel
xlwings - Connecting Python with Excelxlwings - Connecting Python with Excel
xlwings - Connecting Python with Excel
 

Dernier

AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
Alluxio, Inc.
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
Max Lee
 

Dernier (20)

AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
 
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdfStrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
 
Lessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfLessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdf
 
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesGraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java Developers
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
 
architecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfarchitecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdf
 
INGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignINGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by Design
 
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024
 
5 Reasons Driving Warehouse Management Systems Demand
5 Reasons Driving Warehouse Management Systems Demand5 Reasons Driving Warehouse Management Systems Demand
5 Reasons Driving Warehouse Management Systems Demand
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM Integration
 
Microsoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdfMicrosoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdf
 
Workforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdfWorkforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdf
 
Naer Toolbar Redesign - Usability Research Synthesis
Naer Toolbar Redesign - Usability Research SynthesisNaer Toolbar Redesign - Usability Research Synthesis
Naer Toolbar Redesign - Usability Research Synthesis
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in Michelangelo
 

Python and Excel in Finance (PyData meetup Zurich)