SlideShare une entreprise Scribd logo
1  sur  12
Télécharger pour lire hors ligne
xlwings
For Python Quants Conference (London)
28 November 2014 Felix Zumstein, CFA
8 Years in Banking Startup (Feb 2014)
This is Me
2
8 Years in Banking Startup (Feb 2014)
This is Me
3
•  PyXLL
•  DataNitro
•  pywin32
•  xlwings ExcelPython
The current Python/Excel Landscape
4
Read/Write Program/Interact
•  xlwt/xlrd/xlutils
•  XlsxWriter
•  OpenPyxl
Why xlwings?
•  Open source
•  Cross-Platform (!!): Windows & Mac
•  Make things EASY:
– pip install xlwings (requires pywin32 on Win)
– Works out of the box for default installation
– Easily switch between different installations
– Flexible: Python (2.6-3.4), Excel (2000-2013),
Architecture Mix (!!), IDE
– Easy debugging
5
Send an array to Excel with pywin32…
•  xxx
6
>>>	
  from	
  win32com.client	
  import	
  Dispatch	
  
>>>	
  import	
  numpy	
  as	
  np	
  
	
  
>>>	
  xlApp	
  =	
  Dispatch("Excel.Application")	
  
>>>	
  xlApp.Visible	
  =	
  True	
  
>>>	
  xlWb	
  =	
  xlApp.Workbooks.Add()	
  
>>>	
  xlSht	
  =	
  xlWb.ActiveSheet	
  
	
  
>>>	
  data	
  =	
  np.array([[1,2],[3,4]])	
  
>>>	
  r,	
  c	
  =	
  data.shape	
  
>>>	
  xlSht.Range(xlSht.Cells(1,1),	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  xlSht.Cells(r,c)).Value	
  =	
  data.tolist()
…and with xlwings
•  xxx
7
>>>	
  from	
  xlwings	
  import	
  Workbook,	
  Range	
  
>>>	
  import	
  numpy	
  as	
  np	
  
	
  
>>>	
  wb	
  =	
  Workbook()	
  
>>>	
  Range("A1").value	
  =	
  np.array([[1,2],[3,4]])	
  
Replace VBA macros
myarray.py
8
from	
  xlwings	
  import	
  Workbook,	
  Range	
  
import	
  numpy	
  as	
  np	
  
	
  
def	
  get_array():	
  
	
  	
  	
  	
  wb	
  =	
  Workbook.caller()	
  #	
  <v0.3:	
  wb	
  =	
  Workbook()	
  
	
  	
  	
  	
  Range("A1").value	
  =	
  np.array([[1,2],[3,4]])	
  
Sub	
  GetArray()	
  
	
  	
  	
  	
  RunPython	
  ("import	
  myarray;myarray.get_array()")	
  
End	
  Sub	
  
VBA (requires xlwings VBA module)
xlwings v0.3.0
•  Experimental ExcelPython integration:
– Optimized connection on Win (COM server)
– UDFs (User Defined Functions) on Windows
•  Comparison with PyXXL:
ExcelPython is slower and needs a VBA
wrapper, but:
– Allows the Excel 32bit & Python 64bit combo
– Can access existing functions w/o decorators
– It’s easy to switch between Python installations
9
Pseudo Inverse: numpy.linalg.pinv
10
Public	
  Function	
  pinv(x	
  As	
  Range)	
  
On	
  Error	
  GoTo	
  Fail:	
  
	
  	
  	
  	
  Set	
  numpy_array	
  =	
  Py.GetAttr(Py.Module("numpy"),	
  "array")	
  
	
  	
  	
  	
  Set	
  pseudo_inv	
  =	
  Py.GetAttr(Py.GetAttr(Py.Module("numpy"),	
  _	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "linalg"),	
  "pinv")	
  
	
  	
  	
  	
  Set	
  x_array	
  =	
  Py.Call(numpy_array,	
  Py.Tuple(x.Value))	
  
	
  	
  	
  	
  Set	
  result_array	
  =	
  Py.Call(pseudo_inv,	
  Py.Tuple(x_array))	
  
	
  	
  	
  	
  Set	
  result_list	
  =	
  Py.Call(result_array,	
  "tolist")	
  
	
  	
  	
  	
  pinv	
  =	
  Py.Var(result_list)	
  
	
  	
  	
  	
  Exit	
  Function	
  
Fail:	
  
	
  	
  	
  	
  pinv	
  =	
  Err.Description	
  
End	
  Function
What’s next?
•  Add-in
•  Full integration of xlwings and ExcelPython
•  Make it more feature complete
•  Someday…add support for
– Google Sheets
– LibreOffice
– OpenOffice
11
Demo
•  http://xlwings.org
•  http://ericremoreynolds.github.io/excelpython
•  @zoomeranalytics
•  www.zoomeranalytics.com
12

Contenu connexe

Tendances

Prometheus as exposition format for eBPF programs running on Kubernetes
Prometheus as exposition format for eBPF programs running on KubernetesPrometheus as exposition format for eBPF programs running on Kubernetes
Prometheus as exposition format for eBPF programs running on KubernetesLeonardo Di Donato
 
C++ is a general purpose programming language that runs programs using memor...
C++ is a general purpose programming  language that runs programs using memor...C++ is a general purpose programming  language that runs programs using memor...
C++ is a general purpose programming language that runs programs using memor...hwbloom460000
 
Is Python turning into Java? PyData 2017 Berlin Lightning Talk
Is Python turning into Java? PyData 2017 Berlin Lightning TalkIs Python turning into Java? PyData 2017 Berlin Lightning Talk
Is Python turning into Java? PyData 2017 Berlin Lightning TalkSteffen Wenz
 
Clojure - Revenge of the Verbs
Clojure - Revenge of the VerbsClojure - Revenge of the Verbs
Clojure - Revenge of the VerbsTim Lossen
 
Tools for reading papers
Tools for reading papersTools for reading papers
Tools for reading papersJack Fox
 
Distributed Multi-device Execution of TensorFlow – an Outlook
Distributed Multi-device Execution of TensorFlow – an OutlookDistributed Multi-device Execution of TensorFlow – an Outlook
Distributed Multi-device Execution of TensorFlow – an OutlookSebnem Rusitschka
 

Tendances (7)

Prometheus as exposition format for eBPF programs running on Kubernetes
Prometheus as exposition format for eBPF programs running on KubernetesPrometheus as exposition format for eBPF programs running on Kubernetes
Prometheus as exposition format for eBPF programs running on Kubernetes
 
C++ is a general purpose programming language that runs programs using memor...
C++ is a general purpose programming  language that runs programs using memor...C++ is a general purpose programming  language that runs programs using memor...
C++ is a general purpose programming language that runs programs using memor...
 
Is Python turning into Java? PyData 2017 Berlin Lightning Talk
Is Python turning into Java? PyData 2017 Berlin Lightning TalkIs Python turning into Java? PyData 2017 Berlin Lightning Talk
Is Python turning into Java? PyData 2017 Berlin Lightning Talk
 
Clojure - Revenge of the Verbs
Clojure - Revenge of the VerbsClojure - Revenge of the Verbs
Clojure - Revenge of the Verbs
 
Tools for reading papers
Tools for reading papersTools for reading papers
Tools for reading papers
 
CatBoost intro
CatBoost   introCatBoost   intro
CatBoost intro
 
Distributed Multi-device Execution of TensorFlow – an Outlook
Distributed Multi-device Execution of TensorFlow – an OutlookDistributed Multi-device Execution of TensorFlow – an Outlook
Distributed Multi-device Execution of TensorFlow – an Outlook
 

Similaire à xlwings - For Python Quants Conference (London 2014)

Braxton McKee, Founder & CEO, Ufora at MLconf SF - 11/13/15
Braxton McKee, Founder & CEO, Ufora at MLconf SF - 11/13/15Braxton McKee, Founder & CEO, Ufora at MLconf SF - 11/13/15
Braxton McKee, Founder & CEO, Ufora at MLconf SF - 11/13/15MLconf
 
C sharp 8.0 new features
C sharp 8.0 new featuresC sharp 8.0 new features
C sharp 8.0 new featuresMiguel Bernard
 
C sharp 8.0 new features
C sharp 8.0 new featuresC sharp 8.0 new features
C sharp 8.0 new featuresMSDEVMTL
 
Tech3camp Meetup: Python for Excel
Tech3camp Meetup: Python for ExcelTech3camp Meetup: Python for Excel
Tech3camp Meetup: Python for Excelxlwings
 
Parallel Processing with IPython
Parallel Processing with IPythonParallel Processing with IPython
Parallel Processing with IPythonEnthought, Inc.
 
Travis Oliphant "Python for Speed, Scale, and Science"
Travis Oliphant "Python for Speed, Scale, and Science"Travis Oliphant "Python for Speed, Scale, and Science"
Travis Oliphant "Python for Speed, Scale, and Science"Fwdays
 
[PyCon 2014 APAC] How to integrate python into a scala stack to build realtim...
[PyCon 2014 APAC] How to integrate python into a scala stack to build realtim...[PyCon 2014 APAC] How to integrate python into a scala stack to build realtim...
[PyCon 2014 APAC] How to integrate python into a scala stack to build realtim...Jerry Chou
 
PVS-Studio, a solution for resource intensive applications development
PVS-Studio, a solution for resource intensive applications developmentPVS-Studio, a solution for resource intensive applications development
PVS-Studio, a solution for resource intensive applications developmentOOO "Program Verification Systems"
 
Cluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in CCluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in CSteffen Wenz
 
Introduction to python programming 2
Introduction to python programming   2Introduction to python programming   2
Introduction to python programming 2Giovanni Della Lunga
 
Lecture1_introduction to python.pptx
Lecture1_introduction to python.pptxLecture1_introduction to python.pptx
Lecture1_introduction to python.pptxMohammedAlYemeni1
 
Using Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsUsing Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsSerge Stinckwich
 
Scaling Python to CPUs and GPUs
Scaling Python to CPUs and GPUsScaling Python to CPUs and GPUs
Scaling Python to CPUs and GPUsTravis Oliphant
 
EKON 25 Python4Delphi_mX4
EKON 25 Python4Delphi_mX4EKON 25 Python4Delphi_mX4
EKON 25 Python4Delphi_mX4Max Kleiner
 
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...David Walker
 
Python Brasil 2010 - Potter vs Voldemort - Lições ofidiglotas da prática Pyth...
Python Brasil 2010 - Potter vs Voldemort - Lições ofidiglotas da prática Pyth...Python Brasil 2010 - Potter vs Voldemort - Lições ofidiglotas da prática Pyth...
Python Brasil 2010 - Potter vs Voldemort - Lições ofidiglotas da prática Pyth...Rodrigo Senra
 
Gae icc fall2011
Gae icc fall2011Gae icc fall2011
Gae icc fall2011Juan Gomez
 

Similaire à xlwings - For Python Quants Conference (London 2014) (20)

PyCon Estonia 2019
PyCon Estonia 2019PyCon Estonia 2019
PyCon Estonia 2019
 
Braxton McKee, Founder & CEO, Ufora at MLconf SF - 11/13/15
Braxton McKee, Founder & CEO, Ufora at MLconf SF - 11/13/15Braxton McKee, Founder & CEO, Ufora at MLconf SF - 11/13/15
Braxton McKee, Founder & CEO, Ufora at MLconf SF - 11/13/15
 
C sharp 8.0 new features
C sharp 8.0 new featuresC sharp 8.0 new features
C sharp 8.0 new features
 
C sharp 8.0 new features
C sharp 8.0 new featuresC sharp 8.0 new features
C sharp 8.0 new features
 
Tech3camp Meetup: Python for Excel
Tech3camp Meetup: Python for ExcelTech3camp Meetup: Python for Excel
Tech3camp Meetup: Python for Excel
 
Parallel Processing with IPython
Parallel Processing with IPythonParallel Processing with IPython
Parallel Processing with IPython
 
Travis Oliphant "Python for Speed, Scale, and Science"
Travis Oliphant "Python for Speed, Scale, and Science"Travis Oliphant "Python for Speed, Scale, and Science"
Travis Oliphant "Python for Speed, Scale, and Science"
 
[PyCon 2014 APAC] How to integrate python into a scala stack to build realtim...
[PyCon 2014 APAC] How to integrate python into a scala stack to build realtim...[PyCon 2014 APAC] How to integrate python into a scala stack to build realtim...
[PyCon 2014 APAC] How to integrate python into a scala stack to build realtim...
 
PVS-Studio, a solution for resource intensive applications development
PVS-Studio, a solution for resource intensive applications developmentPVS-Studio, a solution for resource intensive applications development
PVS-Studio, a solution for resource intensive applications development
 
Cluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in CCluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in C
 
Introduction to python programming 2
Introduction to python programming   2Introduction to python programming   2
Introduction to python programming 2
 
Lecture1_introduction to python.pptx
Lecture1_introduction to python.pptxLecture1_introduction to python.pptx
Lecture1_introduction to python.pptx
 
Using Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsUsing Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systems
 
Iron python
Iron pythonIron python
Iron python
 
Scaling Python to CPUs and GPUs
Scaling Python to CPUs and GPUsScaling Python to CPUs and GPUs
Scaling Python to CPUs and GPUs
 
EKON 25 Python4Delphi_mX4
EKON 25 Python4Delphi_mX4EKON 25 Python4Delphi_mX4
EKON 25 Python4Delphi_mX4
 
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
 
MXNet Workshop
MXNet WorkshopMXNet Workshop
MXNet Workshop
 
Python Brasil 2010 - Potter vs Voldemort - Lições ofidiglotas da prática Pyth...
Python Brasil 2010 - Potter vs Voldemort - Lições ofidiglotas da prática Pyth...Python Brasil 2010 - Potter vs Voldemort - Lições ofidiglotas da prática Pyth...
Python Brasil 2010 - Potter vs Voldemort - Lições ofidiglotas da prática Pyth...
 
Gae icc fall2011
Gae icc fall2011Gae icc fall2011
Gae icc fall2011
 

Plus de xlwings

xlwings for Google Sheets
xlwings for Google Sheetsxlwings for Google Sheets
xlwings for Google Sheetsxlwings
 
Cross-platform Spreadsheet Automation with Python
Cross-platform Spreadsheet Automation with PythonCross-platform Spreadsheet Automation with Python
Cross-platform Spreadsheet Automation with Pythonxlwings
 
xlwings performance
xlwings performancexlwings performance
xlwings performancexlwings
 
Git for Excel (Webinar)
Git for Excel (Webinar)Git for Excel (Webinar)
Git for Excel (Webinar)xlwings
 
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
 
xlwings reports: Reporting with Excel & Python
xlwings reports: Reporting with Excel & Pythonxlwings reports: Reporting with Excel & Python
xlwings reports: Reporting with Excel & Pythonxlwings
 
Automated testing of Excel Workbooks
Automated testing of Excel WorkbooksAutomated testing of Excel Workbooks
Automated testing of Excel Workbooksxlwings
 
Git for Excel
Git for ExcelGit for Excel
Git for Excelxlwings
 
Automated Testing of Excel Workbooks
Automated Testing of Excel WorkbooksAutomated Testing of Excel Workbooks
Automated Testing of Excel Workbooksxlwings
 
Git for Excel files webinar
Git for Excel files webinarGit for Excel files webinar
Git for Excel files webinarxlwings
 
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 eventxlwings
 
For Python Quants Conference NYC 6th May 2016
For Python Quants Conference NYC 6th May 2016For Python Quants Conference NYC 6th May 2016
For Python Quants Conference NYC 6th May 2016xlwings
 
Odsc presentation
Odsc presentationOdsc presentation
Odsc presentationxlwings
 

Plus de xlwings (13)

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
 
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
 
For Python Quants Conference NYC 6th May 2016
For Python Quants Conference NYC 6th May 2016For Python Quants Conference NYC 6th May 2016
For Python Quants Conference NYC 6th May 2016
 
Odsc presentation
Odsc presentationOdsc presentation
Odsc presentation
 

Dernier

ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfFIDO Alliance
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfFIDO Alliance
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfFIDO Alliance
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfUK Journal
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101vincent683379
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityScyllaDB
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxJennifer Lim
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandIES VE
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxDavid Michel
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPTiSEO AI
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutesconfluent
 

Dernier (20)

ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 

xlwings - For Python Quants Conference (London 2014)

  • 1. xlwings For Python Quants Conference (London) 28 November 2014 Felix Zumstein, CFA
  • 2. 8 Years in Banking Startup (Feb 2014) This is Me 2
  • 3. 8 Years in Banking Startup (Feb 2014) This is Me 3
  • 4. •  PyXLL •  DataNitro •  pywin32 •  xlwings ExcelPython The current Python/Excel Landscape 4 Read/Write Program/Interact •  xlwt/xlrd/xlutils •  XlsxWriter •  OpenPyxl
  • 5. Why xlwings? •  Open source •  Cross-Platform (!!): Windows & Mac •  Make things EASY: – pip install xlwings (requires pywin32 on Win) – Works out of the box for default installation – Easily switch between different installations – Flexible: Python (2.6-3.4), Excel (2000-2013), Architecture Mix (!!), IDE – Easy debugging 5
  • 6. Send an array to Excel with pywin32… •  xxx 6 >>>  from  win32com.client  import  Dispatch   >>>  import  numpy  as  np     >>>  xlApp  =  Dispatch("Excel.Application")   >>>  xlApp.Visible  =  True   >>>  xlWb  =  xlApp.Workbooks.Add()   >>>  xlSht  =  xlWb.ActiveSheet     >>>  data  =  np.array([[1,2],[3,4]])   >>>  r,  c  =  data.shape   >>>  xlSht.Range(xlSht.Cells(1,1),                                  xlSht.Cells(r,c)).Value  =  data.tolist()
  • 7. …and with xlwings •  xxx 7 >>>  from  xlwings  import  Workbook,  Range   >>>  import  numpy  as  np     >>>  wb  =  Workbook()   >>>  Range("A1").value  =  np.array([[1,2],[3,4]])  
  • 8. Replace VBA macros myarray.py 8 from  xlwings  import  Workbook,  Range   import  numpy  as  np     def  get_array():          wb  =  Workbook.caller()  #  <v0.3:  wb  =  Workbook()          Range("A1").value  =  np.array([[1,2],[3,4]])   Sub  GetArray()          RunPython  ("import  myarray;myarray.get_array()")   End  Sub   VBA (requires xlwings VBA module)
  • 9. xlwings v0.3.0 •  Experimental ExcelPython integration: – Optimized connection on Win (COM server) – UDFs (User Defined Functions) on Windows •  Comparison with PyXXL: ExcelPython is slower and needs a VBA wrapper, but: – Allows the Excel 32bit & Python 64bit combo – Can access existing functions w/o decorators – It’s easy to switch between Python installations 9
  • 10. Pseudo Inverse: numpy.linalg.pinv 10 Public  Function  pinv(x  As  Range)   On  Error  GoTo  Fail:          Set  numpy_array  =  Py.GetAttr(Py.Module("numpy"),  "array")          Set  pseudo_inv  =  Py.GetAttr(Py.GetAttr(Py.Module("numpy"),  _                                                                                        "linalg"),  "pinv")          Set  x_array  =  Py.Call(numpy_array,  Py.Tuple(x.Value))          Set  result_array  =  Py.Call(pseudo_inv,  Py.Tuple(x_array))          Set  result_list  =  Py.Call(result_array,  "tolist")          pinv  =  Py.Var(result_list)          Exit  Function   Fail:          pinv  =  Err.Description   End  Function
  • 11. What’s next? •  Add-in •  Full integration of xlwings and ExcelPython •  Make it more feature complete •  Someday…add support for – Google Sheets – LibreOffice – OpenOffice 11