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

Indexing a row of a DataFrame with multiple ExtensionArrays coerces to object #22784

Closed
TomAugspurger opened this issue Sep 20, 2018 · 0 comments · Fixed by #22785
Closed

Indexing a row of a DataFrame with multiple ExtensionArrays coerces to object #22784

TomAugspurger opened this issue Sep 20, 2018 · 0 comments · Fixed by #22785
Labels
Dtype Conversions Unexpected or buggy dtype conversions ExtensionArray Extending pandas with custom dtypes or arrays. Indexing Related to indexing on series/frames, not to indexes themselves
Milestone

Comments

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Sep 20, 2018

Code Sample, a copy-pastable example if possible

In [8]: df = pd.DataFrame({"A": pd.Categorical([1, 2]), "B": pd.Categorical([1, 2])})

In [9]: df.loc[0]
Out[9]:
A    1
B    1
Name: 0, dtype: object

Problem description

The dtype is object. It should be category

Expected Output

A    1
B    1
Name: 0, dtype: category
Categories (2, int64): [1, 2]

(for the release notes)

@TomAugspurger TomAugspurger added Indexing Related to indexing on series/frames, not to indexes themselves Dtype Conversions Unexpected or buggy dtype conversions ExtensionArray Extending pandas with custom dtypes or arrays. labels Sep 20, 2018
@jreback jreback added this to the 0.24.0 milestone Sep 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions ExtensionArray Extending pandas with custom dtypes or arrays. Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants