Skip to content

Conversation

@jbrockmendel
Copy link
Member

  • closes #xxxx
  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them
  • whatsnew entry

# coerces to object
return self.astype(object).putmask(mask, value)
dtype = self._find_common_type_compat(value)
return self.astype(dtype).putmask(mask, value)
Copy link
Contributor

Choose a reason for hiding this comment

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

copy=False?

Copy link
Member Author

Choose a reason for hiding this comment

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

we'll always be making a copy here since dtype != self.dtype


def putmask(self, mask, value):
arr = self._data.copy()
mask = np.asarray(mask, dtype=bool)
Copy link
Contributor

Choose a reason for hiding this comment

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

can't you share / use the array/interval putmask code here?

Copy link
Member Author

Choose a reason for hiding this comment

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

we do; L814-815 is directly using IntervalArray.putmask. everything before that point is for ways that the Index method behaves differently from the array method

@jreback jreback added Dtype Conversions Unexpected or buggy dtype conversions Index Related to the Index class or subclasses labels Jan 28, 2021
@jreback
Copy link
Contributor

jreback commented Jan 28, 2021

needs a rebase. can you add a whatsnew on what is changing here

@jreback
Copy link
Contributor

jreback commented Jan 28, 2021

one more rebase

@jbrockmendel
Copy link
Member Author

rebased + green

@jreback
Copy link
Contributor

jreback commented Feb 2, 2021

can you merge master

@jbrockmendel
Copy link
Member Author

rebased + finally green

@jreback jreback added this to the 1.3 milestone Feb 3, 2021
@jreback jreback merged commit 6b8cc98 into pandas-dev:master Feb 3, 2021
@jbrockmendel jbrockmendel deleted the ref-index-methods branch February 3, 2021 15:05
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 Index Related to the Index class or subclasses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants