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

ENH: Index StringMethods should return MultiIndex when result dimension is more than one #10008

Closed
6 tasks done
mortada opened this issue Apr 28, 2015 · 4 comments
Closed
6 tasks done
Labels
API Design Master Tracker High level tracker for similar issues Strings String extension data type and string data
Milestone

Comments

@mortada
Copy link
Contributor

mortada commented Apr 28, 2015

Currently the Index.str methods only support returning Index results. However, analogous to the expansion from Series.str.* -> DataFrame, we should be able to do Index.str.* -> MultiIndex in certain cases, as discussed in #9870 (comment)

Some of the string methods that can support this are: str.get_dummies, str.extract, str.split

Here are the related PRs: #9667, #9843, #9870, #9985

@jreback jreback added API Design Strings String extension data type and string data labels Apr 29, 2015
@jreback jreback added this to the 0.17.0 milestone Apr 29, 2015
@sinhrks
Copy link
Member

sinhrks commented May 6, 2015

I should have comment here... #9773 is going to have a general logic for expand. Affected methods (in future) are summarized in #9870.

@sinhrks
Copy link
Member

sinhrks commented May 9, 2015

I understand current status is:
-> Checklist is moved to the top.

@jreback jreback added the Master Tracker High level tracker for similar issues label May 9, 2015
@jreback jreback modified the milestones: Next Major Release, 0.17.0 Aug 15, 2015
@sinhrks
Copy link
Member

sinhrks commented May 7, 2016

Index.str.extractall raises AttributeError. Just fix and close.

idx = pd.Index(["a1a2", "b1", "c1"], ["A", "B", "C"])
idx.str.extractall("[ab](?P<digit>\d)")
# AttributeError: 'Index' object has no attribute 'iteritems'

CC: @tdhock

@jreback jreback modified the milestones: 0.18.2, Next Major Release May 7, 2016
@jreback
Copy link
Contributor

jreback commented May 7, 2016

thanks @sinhrks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Master Tracker High level tracker for similar issues Strings String extension data type and string data
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants