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

Index/Series Convergence #17061

Closed
jbrockmendel opened this issue Jul 24, 2017 · 1 comment
Closed

Index/Series Convergence #17061

jbrockmendel opened this issue Jul 24, 2017 · 1 comment
Labels
API Design Needs Discussion Requires discussion from core team before further action

Comments

@jbrockmendel
Copy link
Member

There has been some discussion in #8162 and pandas2#17 about making Index behave more like a regular Series or DataFrame column(s). Is there a consensus towards moving in that direction? In particular, I'm thinking about:

  • DatetimeIndex, PeriodIndex, TimedeltaIndex could have a property dt that returns self. Then users can access foo.dt without having to check whether foo is a Series or Index.

  • If StringAccessorMixin is deprecated (which can be done with a tiny subset of WIP: Refactor accessors, unify usage, make "recipe" #17042), Index can have _accessors, _dir_deletions, and _dir_additions copy/pasted from Series.

  • Less obvious so more of an implied question: Index.map seems to behave a lot like Series.apply and less like Series.map. Any reason not to alias Index.apply = Index.map?

Related Index/MultiIndex compat, a non-multi Index could have self.levels = [self], so users can iterate over levels without pre-checking.

@gfyoung gfyoung added API Design Needs Discussion Requires discussion from core team before further action labels Jul 24, 2017
@jreback
Copy link
Contributor

jreback commented Jul 24, 2017

I would rather add to the previous issues rather than creating a new one. Further there already is an issue w.r.t. .map/.apply. see if you can link to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Needs Discussion Requires discussion from core team before further action
Projects
None yet
Development

No branches or pull requests

3 participants