REF: remove putmask_preserve, putmask_without_repeat
State: closed

No longer needed following #44275

Labels:
name: Refactor
description: Internal refactoring of code
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves

Comments:
This one broke ``test_where_axis`` with 

```
pandas/tests/frame/indexing/test_where.py:456 (TestDataFrameIndexingWhere.test_where_axis)
self = <pandas.tests.frame.indexing.test_where.TestDataFrameIndexingWhere object at 0x7f378663f250>

    def test_where_axis(self):
        # GH 9736
        df = DataFrame(np.random.randn(2, 2))
        mask = DataFrame([[False, False], [False, False]])
        s = Series([0, 1])
    
        expected = DataFrame([[0, 0], [1, 1]], dtype="float64")
        result = df.where(mask, s, axis="index")
        tm.assert_frame_equal(result, expected)
    
        result = df.copy()
        return_value = result.where(mask, s, axis="index", inplace=True)
        assert return_value is None
        tm.assert_frame_equal(result, expected)
    
        expected = DataFrame([[0, 1], [0, 1]], dtype="float64")
        result = df.where(mask, s, axis="columns")
        tm.assert_frame_equal(result, expected)
    
        result = df.copy()
        return_value = result.where(mask, s, axis="columns", inplace=True)
        assert return_value is None
        tm.assert_frame_equal(result, expected)
    
        # Upcast needed
        df = DataFrame([[1, 2], [3, 4]], dtype="int64")
        mask = DataFrame([[False, False], [False, False]])
        s = Series([0, np.nan])
    
        expected = DataFrame([[0, 0], [np.nan, np.nan]], dtype="float64")
        result = df.where(mask, s, axis="index")
        tm.assert_frame_equal(result, expected)
    
        result = df.copy()
        return_value = result.where(mask, s, axis="index", inplace=True)
        assert return_value is None
        tm.assert_frame_equal(result, expected)
    
        expected = DataFrame([[0, np.nan], [0, np.nan]])
        result = df.where(mask, s, axis="columns")
        tm.assert_frame_equal(result, expected)
    
        expected = DataFrame(
            {
                0: np.array([0, 0], dtype="int64"),
                1: np.array([np.nan, np.nan], dtype="float64"),
            }
        )
        result = df.copy()
>       return_value = result.where(mask, s, axis="columns", inplace=True)

test_where.py:506: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../util/_decorators.py:311: in wrapper
    return func(*args, **kwargs)
../../../core/frame.py:10912: in where
    return super().where(cond, other, inplace, axis, level, errors, try_cast)
../../../core/generic.py:9196: in where
    return self._where(cond, other, inplace, axis, level, errors=errors)
../../../core/generic.py:9030: in _where
    new_data = self._mgr.putmask(mask=cond, new=other, align=align)
../../../core/internals/managers.py:348: in putmask
    return self.apply(
../../../core/internals/managers.py:305: in apply
    applied = getattr(b, f)(**kwargs)
../../../core/internals/blocks.py:996: in putmask
    rbs = nb.putmask(submask, n)
../../../core/internals/blocks.py:963: in putmask
    np.putmask(self.values.T, mask, new)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (array([[1],
       [3]]), array([[ True],
       [ True]]), array([[0.],
       [0.]]))
kwargs = {}
relevant_args = (array([[1],
       [3]]), array([[ True],
       [ True]]), array([[0.],
       [0.]]))

>   ???
E   TypeError: Cannot cast array data from dtype('float64') to dtype('int64') according to the rule 'safe'
```
Darn.  OK let's revert and i'll try again.