Python for Finance: Analyze Big Financial Data

(Elle) #1

Conclusions


There are several options to integrate Python with Excel. Some Python libraries — like


xlwt or xlsxwriter — allow the creation of Excel spreadsheets. Other libraries like xlrd


allow the reading of arbitrary spreadsheet files, or they allow both reading and writing of


spreadsheet files.


pandas is, at least for some tasks, also helpful. For example, it is useful when it comes to


writing larger data sets to a spreadsheet file or when it comes to reading data stored in


such a file format.


The most powerful solution, however, at the time of this writing is the one by DataNitro


that offers a tight integration of both worlds. It has similar (or even better) spreadsheet


manipulation capabilities than other libraries. In addition, DataNitro allows us, for


example, to expose Python plots to Excel spreadsheets. More importantly, it allows us to


define user-defined Python functions (UDFs) for usage with Excel that are callable in the


same way as Excel’s built-in functions are. xlwings, a new, open source library that has


been made available recently, is similar in scope and capabilities to the DataNitro


solution.


In particular, the DataNitro and xlwings approaches allow us to use Excel as a flexible


and powerful general GUI — available on almost every computer in the finance industry


— and combine it with the analytical capabilities of Python. The best of both worlds, so to


say.

Free download pdf