Skip to main content

Load pandas DataFrames in Excel

Project description


Very quickly load pandas DataFrames in Excel

Python is awesome and I love it for doing all sorts of data manipulation. But sometimes Microsoft Excel remains the best place to do quick data exploration and filtering. So thanks to the brilliant xlwings, it's easy to integrate the two. This module has some very simple functions to make this as easy as possible.

Say you have this script:

>>> df = read_data()
>>> result = df.groupby("blah")[vars].agg(something_complex)

And you want to explore result quickly in Excel, you can do the following. This and all the following examples will immediately launch the DataFrame in a new Excel Workbook on your desktop via a non-blocking call.

>>> from excellentpandas import show_in_excel
>>> df = read_data()
>>> result = df.groupby("blah")[vars].agg(something_complex).pipe(via_excel)
>>> show_in_excel(result)


>>> from excellentpandas import via_excel
>>> df = read_data()
>>> result = df.groupby("blah")[vars].agg(something_complex).pipe(via_excel)

My favourite also prints to the console:

>>> from excellentpandas import via_info_excel
>>> df = read_data()
>>> result = df.groupby("blah")[vars].agg(something_complex).pipe(via_info_excel)
<class 'pandas.core.frame.DataFrame'>
Int64Index: 16 entries, 2004 to 2019
Data columns (total 6 columns):
dtypes: float64(6)
memory usage: 896.0 bytes

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

excellentpandas-0.1.0.tar.gz (2.0 kB view hashes)

Uploaded source

Built Distribution

excellentpandas-0.1.0-py3-none-any.whl (2.4 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page