Skip to content

Conversation

@sinhrks
Copy link
Member

@sinhrks sinhrks commented Mar 5, 2016

Made CategoricalIndex.get_loc to return the same result as normal Index.

data2 = pd.DataFrame([[1,2,3],[3,4,5]], index=pd.Categorical(['one', 'two']))

# in current master, it returns DataFrame with 1 row 
data2.ix['one']
#      0  1  2
# one  1  2  3

# after this PR, it returns Series
data2.ix['one']
#0    1
#1    2
#2    3
# Name: one, dtype: int64

@sinhrks sinhrks added Indexing Related to indexing on series/frames, not to indexes themselves Categorical Categorical Data Type labels Mar 5, 2016
@sinhrks sinhrks added this to the 0.18.1 milestone Mar 5, 2016
@jreback
Copy link
Contributor

jreback commented Mar 12, 2016

@sinhrks this looks good. but is this the correct reference issue: #11588 ?

@sinhrks
Copy link
Member Author

sinhrks commented Mar 14, 2016

Ah, related to #11558, but can't close only by this PR. Fixed the doc and comment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move these tests to tests/indexing/tests_categoricaly.py (I just reorged this recently)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, moved.

@jreback
Copy link
Contributor

jreback commented Mar 15, 2016

@sinhrks thanks! nice PR as usual

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Categorical Categorical Data Type Indexing Related to indexing on series/frames, not to indexes themselves

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants