Archive for the 'Finance' category

The Latest and Greatest Pandas Features (since v 0.11)

Jun 20 2014 Published by under Finance, General, Python

On May 28, 2014 Phillip Cloud, core contributor for the Pandas data analytics Python library, spoke at a joint meetup of the New York Quantitative Python User’s Group (NY QPUG) and the NY Finance PUG. Enthought hosted and about 60 people joined us to listen to Phillip present some of the less-well-known, but really useful features that have come out since Pandas version 0.11 and some that are coming soon. We all learned more about how to take full advantage of the Pandas Python library, and got a better sense of how excited Phillip was to discover Pandas during his graduate work.

Pandas to MATLAB

After a fairly comprehensive overview of Pandas, Phillip got into the new features. In version 0.11 he covered:

  • indexers loc/at, iloc/iat,
  • dtypes,
  • using numexpr to evaluate arithmetic expressions for large objects, focusing mainly on numexpr. Then in version 0.12 he went into some depth on read_html. In the process he read data from a website and re-created a plot from the website. His examples are valuable as a way to see how an expert uses the Pandas package. He also goes over read_json and others new features as well, again with some really interesting examples.

Phillip covered some experimental features in version 0.13 including query/eval, msgpack IO and Google BigQuery IO. He then wrapped up with a sneak peak at some version 0.14 (soon to be released) features including MultiIndex slicing. His MultiIndex slicing example comes from his work on neuroscience (his cool data collection system is in the figure below).

You can watch his presentation below (thank you to Aaron Watters for holding up my iPhone for close to 30min from the second row to get shots of Phillip speaking), and you can get his iPython Notebooks from the talk as well.

The Latest and Greatest Pandas Features (since v 0.11) from NYQPUG.

 

No responses yet

PyXLL: Deploy Python to Excel Easily

Feb 06 2014 Published by under Canopy, Enthought Canopy, Finance, News, Python, PyXLL

PyXLL Solution Home | Buy PyXLL | Press Release

Today Enthought announced that it is now the worldwide distributor for PyXLL, and we’re excited to offer this key product for deploying Python models, algorithms and code to Excel. Technical teams can use the full power of Enthought Canopy, or another Python distro, and end-users can access the results in their familiar Excel environment. And it’s straightforward to set up and use.

Installing PyXLL from Enthought Canopy

PyXLL is available as a package subscription (with significant discounts for multiple users). Once you’ve purchased a subscription you can easily install it via Canopy’s Package Manager as shown in the screenshots below (note that at this time PyXLL is only available for Windows users). The rest of the configuration instructions are in the Quick Start portion of the documentation. PyXLL itself is a plug-in to Excel. When you start Excel, PyXLL loads into Excel and reads in Python modules that you have created for PyXLL. This makes PyXLL especially useful for organizations that want to manage their code centrally and deploy to multiple Excel users.

Enthought Canopy Package Manager   Install PyXLL from Enthought Canopy's Package Manager

Creating Excel Functions with PyXLL

To create a PyXLL Python Excel function, you use the @xl_func decorator to tell PyXLL the following function should be registered with Excel, what its argument types are, and optionally what its return type is. PyXLL also reads the function’s docstring and provides that in the Excel function description. As an example, I created a module my_pyxll_module.py and registered it with PyXLL via the PyXLL config file. In that module I put a simple function pyfib(): a naive Fibonacci implementation.

When I start Excel, I can access the Excel function wizard and find my pyfib() function and use it. The function documentation in Excel comes from my docstring. PyXLL parses the “n: integer input” portion as the variable documentation.

If I go back and make a change to the function, I can reload PyXLL without restarting Excel and update the cells. If I add another function to my module, it too will get loaded and be available to use in my worksheet.

So if you are developing Python models or functions for a large number of distributed Excel users, you can manage the code centrally. PyXLL will load new versions and new functions from the central repository whenever a user starts Excel. Deployment is very straightforward, and central management of all the code reduces the risk of Excel macros and functions proliferating uncontrolled.

I can also create menu functions using the decorator @xl_menu. PyXLL ships with several examples that you can start with. The one below adds a menu item to the Excel Add-in menu, and pops up a message box when selected.

       

13 responses so far

Older posts »

Featuring Advanced Search Functions plugin by YD