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
mortada opened this Issue Apr 28, 2015 · 4 comments

Comments

Projects
None yet
3 participants
@mortada
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 this to the 0.17.0 milestone Apr 29, 2015

@sinhrks

This comment has been minimized.

Show comment
Hide comment
@sinhrks

sinhrks May 6, 2015

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@sinhrks

sinhrks May 9, 2015

Member

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

Member

sinhrks commented May 9, 2015

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

@jreback jreback modified the milestones: Next Major Release, 0.17.0 Aug 15, 2015

@sinhrks

This comment has been minimized.

Show comment
Hide comment
@sinhrks

sinhrks May 7, 2016

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@jreback

jreback May 7, 2016

Contributor

thanks @sinhrks

Contributor

jreback commented May 7, 2016

thanks @sinhrks

@sinhrks sinhrks referenced this issue May 12, 2016

Closed

ENH/BUG: str.extractall doesn't support index #13156

4 of 4 tasks complete

@jreback jreback closed this in 82f54bd May 13, 2016

nps added a commit to nps/pandas that referenced this issue May 17, 2016

ENH/BUG: str.extractall doesn't support index
closes pandas-dev#10008

Author: sinhrks <sinhrks@gmail.com>

Closes pandas-dev#13156 from sinhrks/str_extractall and squashes the following commits:

ed854ef [sinhrks] ENH/BUG: str.extractall doesn't support index
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment