Skip to content

BUG: Series[Period][mask] = 'foo' raising inconsistent with non-mask indexing #45768

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 2 commits into from
Feb 2, 2022

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

e.g.

ser = pd.Series(pd.period_range("2016-01-01", periods=3))
mask = np.array([True, False, True])
ser[mask] = 4  # <- raises in main
ser[mask.nonzero()[0]] = 4  # <- coerces in main

same thing for IntervalDtype. This inconsistency is enough that I'm comfortable calling this a bugfix and not an API change.

@jreback jreback added Bug Dtype Conversions Unexpected or buggy dtype conversions Indexing Related to indexing on series/frames, not to indexes themselves Interval Interval data type Period Period data type labels Feb 2, 2022
@jreback jreback added this to the 1.5 milestone Feb 2, 2022
@jreback jreback merged commit be8d1ec into pandas-dev:main Feb 2, 2022
@jbrockmendel jbrockmendel deleted the api-standardize-fallback branch February 2, 2022 03:53
phofl pushed a commit to phofl/pandas that referenced this pull request Feb 14, 2022
yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions Indexing Related to indexing on series/frames, not to indexes themselves Interval Interval data type Period Period data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants