Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using dim expressions as accessors #4311

Merged
merged 7 commits into from
Mar 23, 2020
Merged

Allow using dim expressions as accessors #4311

merged 7 commits into from
Mar 23, 2020

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Mar 22, 2020

In a recent PR we added support for dim expressions which can call arbitrary functions on the datastructure they will be applied to. This PR generalizes this mechanism to allow not just calling methods but also using accessors on the underlying object, e.g. to use datetime accessors on a pandas Series:

dim_expr = hv.dim('dates').dt.week
ds = hv.Dataset(pd.date_range('2012', '2013'), 'dates', datatype=['dataframe'])
ds.transform(week=dim_expr).data

Screen Shot 2020-03-22 at 8 31 05 PM

@philippjfr philippjfr merged commit b7fb3ec into master Mar 23, 2020
@philippjfr philippjfr deleted the dim_accessors branch April 25, 2022 14:44
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant