Skip to content

BUG: setting categorical values into object dtype DataFrame #39136

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

Merged
merged 4 commits into from
Jan 14, 2021

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx
  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them
  • whatsnew entry
df = pd.DataFrame({"A": range(3)}, dtype=object)
cat = pd.Categorical(["alpha", "beta", "gamma"])

df.iloc[range(3), 0] = cat

>>> df
     A
0  NaN
1     
2     

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

can you add a whatsnew as well

@jreback jreback added Bug Categorical Categorical Data Type Indexing Related to indexing on series/frames, not to indexes themselves labels Jan 13, 2021
@jreback jreback added this to the 1.3 milestone Jan 14, 2021
@jreback jreback merged commit 8e0acdf into pandas-dev:master Jan 14, 2021
@jbrockmendel jbrockmendel deleted the bug-setitem-cat branch January 14, 2021 21:54
luckyvs1 pushed a commit to luckyvs1/pandas that referenced this pull request Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 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