Skip to content

Update API to use Pandas Accessor Extensions#50

Open
HHammond wants to merge 7 commits intomasterfrom
use-pandas-accessors
Open

Update API to use Pandas Accessor Extensions#50
HHammond wants to merge 7 commits intomasterfrom
use-pandas-accessors

Conversation

@HHammond
Copy link
Owner

After looking over https://pandas.pydata.org/pandas-docs/stable/extending.html I've extended the PrettyPandas API to use pandas accessors.

With this update you can now write code like this:

(
    df
    .summarize
    .average()
    .total(axis=1)
    .as_percent(subset=['a', 'Total'])
    .as_currency('EUR', subset=['b'])
)

This PR also has a few bug fixes and expanded support for pandas Series objects.

@Zsailer
Copy link

Zsailer commented Oct 16, 2019

@HHammond great stuff here.

I thought I'd point you to pandas-flavor. It backports the Pandas extensions API to older versions of Pandas. It also includes method registration, enabling you to register methods directly to DataFrame and Series APIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants