Skip to content

Panel.apply() still uses np.apply_along_axis, discarding the indices and labels #5556

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

Closed
aldanor opened this issue Nov 20, 2013 · 4 comments
Closed
Labels
Duplicate Report Duplicate issue or pull request

Comments

@aldanor
Copy link
Contributor

aldanor commented Nov 20, 2013

Panel.apply(func, axis) currently just pulls out .values and passes them to numpy.apply_along_axis -- which makes its utility questionable since all the indices and labels get lost in the process.

Wouldn't it make much more sense to pass DataFrames to the func and then try and recombine the result into either Series, DataFrame or a Panel?

By the way, this behaviour is not in the docs and is inconsistent with how apply works for series/frames, so an unwary user might be in for a surprise.

@jreback
Copy link
Contributor

jreback commented Nov 20, 2013

this is a dupe of #1148; I have a working branch of this, but going to happen in 0.14. you are of course welcome too it if you'd like :)

@jreback
Copy link
Contributor

jreback commented Nov 20, 2013

here's the branch: https://github.com/jreback/pandas/tree/panel_apply, need to figure out the alignment issues

@aldanor
Copy link
Contributor Author

aldanor commented Nov 20, 2013

Great, thanks, will take a look later.

@jreback
Copy link
Contributor

jreback commented Jan 4, 2014

@aldanor #5850 is my implementation of this..pls check out and lmk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request
Projects
None yet
Development

No branches or pull requests

2 participants