SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Downloaden Sie, um offline zu lesen
O P E N
D A T A
S C I E N C E
C O N F E R E N C E_
BOSTON 2015
@opendatasci
xlwings Felix Zumstein
About me
•  Startup (2014, Zurich):
– Mainly Python for Finance
– Web based trading solutions
(Interactive Brokers)
– Lots of Excel
– Open-source: xlwings/ExcelPython
•  Previously: 9yrs in Banking /Asset Mgmt
•  Background in Finance & Economics
2
What’s in this talk?
3
The open-source Python/Excel Landscape
4
•  Pywin32
•  xlwings
•  ExcelPython
Read/Write Program/Interact
•  xlwt/xlrd
•  XlsxWriter
•  OpenPyxl
Why xlwings?
– 6 Reasons
5
(1) Installation
6
•  pip/conda install xlwings
•  or equally easy:
(2) Cross-Platform
7
+
(3) Flexibility
8
Version
2.6
2.7
3.1
3.2
3.3
3.4
32-bit
64-bit
32-bit
64-bit
2003
2010
2011 (Mac)
2013
2016 (Win + Mac*)
ArchitectureVersion Architecture
*under development
(4) Simplicity
9
>>>	
  from	
  xlwings	
  import	
  Workbook,	
  Range	
  
	
  
>>>	
  wb	
  =	
  Workbook()	
  
>>>	
  Range("A1").value	
  =	
  my_variable	
  
•  Strings
•  Numbers
•  DateTime
•  Lists (nested)
•  NumPy arrays
•  Pandas DataFrames
•  Blaze Data container (planned)
(5) Works back and forth
10
>>>	
  wb	
  =	
  Workbook()	
  
>>>	
  Range("A1").value	
  =	
  my_variable	
  
Sub	
  MyFunction()	
  
	
  RunPython	
  ("import	
  mymodule;mymodule.myfunction()")	
  
End	
  Sub	
  
(6) ExcelPython for UDFs (Windows only)
11
from	
  xlpython	
  import	
  xlfunc	
  
import	
  numpy	
  as	
  np	
  
	
  
@xlfunc	
  
def	
  matrix_mult(x,	
  y):	
  
	
  	
  	
  	
  x	
  =	
  np.atleast_2d(np.array(x))	
  
	
  	
  	
  	
  y	
  =	
  np.atleast_2d(np.array(y))	
  
	
  	
  	
  	
  return	
  x.dot(y)	
  
{=matrix_mult(A1:B2,D1:E2)}	
  
Access from Excel via Array Formula:
Write User Defined Functions in Python:
What’s next?
12
What’s next?
•  Add-in
•  Full integration of xlwings/ExcelPython
•  Add more features: matplotlib etc.
•  Someday…
– Google Sheets
– LibreOffice/OpenOffice
13
julia>	
  using	
  PyCall	
  
julia>	
  @pyimport	
  xlwings	
  as	
  xw	
  
	
  
julia>	
  xw.Workbook()	
  
julia>	
  xw.Range("A1",	
  asarray=true)[:table][:value]	
  
	
  
Use xlwings from Julia
14
>>>	
  from	
  xlwings	
  import	
  Workbook,	
  Range	
  
	
  
>>>	
  wb	
  =	
  Workbook()	
  
>>>	
  Range("A1",	
  asarray=True).table.value	
  
DEMO
xlwings.org
15

Weitere ähnliche Inhalte

Ähnlich wie xlwings – Make Excel Fly with Python

Ploneconf2012 talk
Ploneconf2012 talkPloneconf2012 talk
Ploneconf2012 talk
simahawk
 
Resume_Anton_Boshoff
Resume_Anton_BoshoffResume_Anton_Boshoff
Resume_Anton_Boshoff
Anton Boshoff
 
suresh.TIBCO1
suresh.TIBCO1suresh.TIBCO1
suresh.TIBCO1
suresh kv
 
TYPO3 6.2 LTS - TYPO3 Conference Stuttgart, 2013
TYPO3 6.2 LTS - TYPO3 Conference Stuttgart, 2013TYPO3 6.2 LTS - TYPO3 Conference Stuttgart, 2013
TYPO3 6.2 LTS - TYPO3 Conference Stuttgart, 2013
Ernesto Baschny
 
Dd13.2013.milano.open ntf
Dd13.2013.milano.open ntfDd13.2013.milano.open ntf
Dd13.2013.milano.open ntf
Ulrich Krause
 
Surfacing ‘101’ in a Linked Data manner as presented at SATToSE 2013
Surfacing ‘101’ in a Linked Data manner as presented at SATToSE 2013Surfacing ‘101’ in a Linked Data manner as presented at SATToSE 2013
Surfacing ‘101’ in a Linked Data manner as presented at SATToSE 2013
Ralf Laemmel
 

Ähnlich wie xlwings – Make Excel Fly with Python (20)

A Model-Based Systems Engineering Approach to Portfolio Management
A Model-Based Systems Engineering Approach to Portfolio ManagementA Model-Based Systems Engineering Approach to Portfolio Management
A Model-Based Systems Engineering Approach to Portfolio Management
 
Technology Roadmap by ericnel
Technology Roadmap by ericnelTechnology Roadmap by ericnel
Technology Roadmap by ericnel
 
Ploneconf2012 talk
Ploneconf2012 talkPloneconf2012 talk
Ploneconf2012 talk
 
CV Template
CV TemplateCV Template
CV Template
 
Presentation Exo Platform
Presentation Exo PlatformPresentation Exo Platform
Presentation Exo Platform
 
GENIVI + OCF Cooperation
GENIVI + OCF CooperationGENIVI + OCF Cooperation
GENIVI + OCF Cooperation
 
OpenTelemetry 101 FTW
OpenTelemetry 101 FTWOpenTelemetry 101 FTW
OpenTelemetry 101 FTW
 
Resume_Anton_Boshoff
Resume_Anton_BoshoffResume_Anton_Boshoff
Resume_Anton_Boshoff
 
Elisa Appelsiini Agile Production Model
Elisa Appelsiini Agile Production ModelElisa Appelsiini Agile Production Model
Elisa Appelsiini Agile Production Model
 
Connected Tizen: Bringing Tizen to Your Connected Devices Using the Yocto Pro...
Connected Tizen: Bringing Tizen to Your Connected Devices Using the Yocto Pro...Connected Tizen: Bringing Tizen to Your Connected Devices Using the Yocto Pro...
Connected Tizen: Bringing Tizen to Your Connected Devices Using the Yocto Pro...
 
suresh.TIBCO1
suresh.TIBCO1suresh.TIBCO1
suresh.TIBCO1
 
The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13
The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13
The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13
 
TYPO3 6.2 LTS - TYPO3 Conference Stuttgart, 2013
TYPO3 6.2 LTS - TYPO3 Conference Stuttgart, 2013TYPO3 6.2 LTS - TYPO3 Conference Stuttgart, 2013
TYPO3 6.2 LTS - TYPO3 Conference Stuttgart, 2013
 
Dd13.2013.milano.open ntf
Dd13.2013.milano.open ntfDd13.2013.milano.open ntf
Dd13.2013.milano.open ntf
 
Creating the open source building blocks for IoT
Creating the open source building blocks for IoT Creating the open source building blocks for IoT
Creating the open source building blocks for IoT
 
Mark Hughes Annual Seminar Presentation on Open Source
Mark Hughes Annual Seminar Presentation on Open Source Mark Hughes Annual Seminar Presentation on Open Source
Mark Hughes Annual Seminar Presentation on Open Source
 
Cross-platform Spreadsheet Automation with Python
Cross-platform Spreadsheet Automation with PythonCross-platform Spreadsheet Automation with Python
Cross-platform Spreadsheet Automation with Python
 
Learn How-To Build Your IoT Project
Learn How-To Build Your IoT ProjectLearn How-To Build Your IoT Project
Learn How-To Build Your IoT Project
 
Open Source on the Mainframe Mini-Summit 2019 - How Open Source is Modernizin...
Open Source on the Mainframe Mini-Summit 2019 - How Open Source is Modernizin...Open Source on the Mainframe Mini-Summit 2019 - How Open Source is Modernizin...
Open Source on the Mainframe Mini-Summit 2019 - How Open Source is Modernizin...
 
Surfacing ‘101’ in a Linked Data manner as presented at SATToSE 2013
Surfacing ‘101’ in a Linked Data manner as presented at SATToSE 2013Surfacing ‘101’ in a Linked Data manner as presented at SATToSE 2013
Surfacing ‘101’ in a Linked Data manner as presented at SATToSE 2013
 

Mehr von odsc

Kaggle The Home of Data Science
Kaggle The Home of Data ScienceKaggle The Home of Data Science
Kaggle The Home of Data Science
odsc
 
The Art of Data Science
The Art of Data Science The Art of Data Science
The Art of Data Science
odsc
 
Frontiers of Open Data Science Research
Frontiers of Open Data Science ResearchFrontiers of Open Data Science Research
Frontiers of Open Data Science Research
odsc
 

Mehr von odsc (20)

Understanding the Chief Data Officer
Understanding the Chief Data Officer Understanding the Chief Data Officer
Understanding the Chief Data Officer
 
Machine-In-The-Loop for Knowledge Discovery
Machine-In-The-Loop for Knowledge DiscoveryMachine-In-The-Loop for Knowledge Discovery
Machine-In-The-Loop for Knowledge Discovery
 
API Driven Development
API Driven Development API Driven Development
API Driven Development
 
Mobile technology Usage by Humanitarian Programs: A Metadata Analysis
Mobile technology Usage by Humanitarian Programs: A Metadata AnalysisMobile technology Usage by Humanitarian Programs: A Metadata Analysis
Mobile technology Usage by Humanitarian Programs: A Metadata Analysis
 
Productionizing Deep Learning From the Ground Up
Productionizing Deep Learning From the Ground UpProductionizing Deep Learning From the Ground Up
Productionizing Deep Learning From the Ground Up
 
Big Data Infrastructure: Introduction to Hadoop with MapReduce, Pig, and Hive
Big Data Infrastructure: Introduction to Hadoop with MapReduce, Pig, and HiveBig Data Infrastructure: Introduction to Hadoop with MapReduce, Pig, and Hive
Big Data Infrastructure: Introduction to Hadoop with MapReduce, Pig, and Hive
 
Think Breadth, Not Depth
Think Breadth, Not DepthThink Breadth, Not Depth
Think Breadth, Not Depth
 
Data Science at Dow Jones: Monetizing Data, News and Information
Data Science at Dow Jones: Monetizing Data, News and InformationData Science at Dow Jones: Monetizing Data, News and Information
Data Science at Dow Jones: Monetizing Data, News and Information
 
Spark, Python and Parquet
Spark, Python and Parquet Spark, Python and Parquet
Spark, Python and Parquet
 
Building a Predictive Analytics Solution with Azure ML
Building a Predictive Analytics Solution with Azure MLBuilding a Predictive Analytics Solution with Azure ML
Building a Predictive Analytics Solution with Azure ML
 
Beyond Names
Beyond NamesBeyond Names
Beyond Names
 
How Woman are Conquering the S&P 500
How Woman are Conquering the S&P 500How Woman are Conquering the S&P 500
How Woman are Conquering the S&P 500
 
Domain Expertise and Unstructured Data
Domain Expertise and Unstructured DataDomain Expertise and Unstructured Data
Domain Expertise and Unstructured Data
 
Kaggle The Home of Data Science
Kaggle The Home of Data ScienceKaggle The Home of Data Science
Kaggle The Home of Data Science
 
Open Source Tools & Data Science Competitions
Open Source Tools & Data Science Competitions Open Source Tools & Data Science Competitions
Open Source Tools & Data Science Competitions
 
Machine Learning with scikit-learn
Machine Learning with scikit-learnMachine Learning with scikit-learn
Machine Learning with scikit-learn
 
Bridging the Gap Between Data and Insight using Open-Source Tools
Bridging the Gap Between Data and Insight using Open-Source ToolsBridging the Gap Between Data and Insight using Open-Source Tools
Bridging the Gap Between Data and Insight using Open-Source Tools
 
Top 10 Signs of the Textpocalypse
Top 10 Signs of the TextpocalypseTop 10 Signs of the Textpocalypse
Top 10 Signs of the Textpocalypse
 
The Art of Data Science
The Art of Data Science The Art of Data Science
The Art of Data Science
 
Frontiers of Open Data Science Research
Frontiers of Open Data Science ResearchFrontiers of Open Data Science Research
Frontiers of Open Data Science Research
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 

xlwings – Make Excel Fly with Python

  • 1. O P E N D A T A S C I E N C E C O N F E R E N C E_ BOSTON 2015 @opendatasci xlwings Felix Zumstein
  • 2. About me •  Startup (2014, Zurich): – Mainly Python for Finance – Web based trading solutions (Interactive Brokers) – Lots of Excel – Open-source: xlwings/ExcelPython •  Previously: 9yrs in Banking /Asset Mgmt •  Background in Finance & Economics 2
  • 4. The open-source Python/Excel Landscape 4 •  Pywin32 •  xlwings •  ExcelPython Read/Write Program/Interact •  xlwt/xlrd •  XlsxWriter •  OpenPyxl
  • 5. Why xlwings? – 6 Reasons 5
  • 6. (1) Installation 6 •  pip/conda install xlwings •  or equally easy:
  • 9. (4) Simplicity 9 >>>  from  xlwings  import  Workbook,  Range     >>>  wb  =  Workbook()   >>>  Range("A1").value  =  my_variable   •  Strings •  Numbers •  DateTime •  Lists (nested) •  NumPy arrays •  Pandas DataFrames •  Blaze Data container (planned)
  • 10. (5) Works back and forth 10 >>>  wb  =  Workbook()   >>>  Range("A1").value  =  my_variable   Sub  MyFunction()    RunPython  ("import  mymodule;mymodule.myfunction()")   End  Sub  
  • 11. (6) ExcelPython for UDFs (Windows only) 11 from  xlpython  import  xlfunc   import  numpy  as  np     @xlfunc   def  matrix_mult(x,  y):          x  =  np.atleast_2d(np.array(x))          y  =  np.atleast_2d(np.array(y))          return  x.dot(y)   {=matrix_mult(A1:B2,D1:E2)}   Access from Excel via Array Formula: Write User Defined Functions in Python:
  • 13. What’s next? •  Add-in •  Full integration of xlwings/ExcelPython •  Add more features: matplotlib etc. •  Someday… – Google Sheets – LibreOffice/OpenOffice 13
  • 14. julia>  using  PyCall   julia>  @pyimport  xlwings  as  xw     julia>  xw.Workbook()   julia>  xw.Range("A1",  asarray=true)[:table][:value]     Use xlwings from Julia 14 >>>  from  xlwings  import  Workbook,  Range     >>>  wb  =  Workbook()   >>>  Range("A1",  asarray=True).table.value