def putmask(self, mask, value):
        """
        return a new Index of the values set with the mask

        See also
        --------
        numpy.ndarray.putmask
        """
        values = self.values.copy()
        try:
            np.putmask(values, mask, self._convert_for_op(value))
            return self._shallow_copy(values)
        except (ValueError, __HOLE__):
            # coerces to object
            return self.astype(object).putmask(mask, value)
dataset/ETHPy150Open pydata/pandas/pandas/indexes/base.py/Index.putmask