Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v2.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Removal of prior version deprecations/changes
- Removed deprecated :meth:`Categorical.replace`, use :meth:`Series.replace` instead (:issue:`44929`)
- Removed the ``numeric_only`` keyword from :meth:`Categorical.min` and :meth:`Categorical.max` in favor of ``skipna`` (:issue:`48821`)
- Removed :func:`is_extension_type` in favor of :func:`is_extension_array_dtype` (:issue:`29457`)
- Removed :meth:`Index.get_value` (:issue:`33907`)
- Removed :meth:`Index.get_value` and :meth:`Index.set_value` (:issue:`33907`, :issue:`28621`)
- Remove :meth:`DataFrameGroupBy.pad` and :meth:`DataFrameGroupBy.backfill` (:issue:`45076`)
- Remove ``numpy`` argument from :func:`read_json` (:issue:`30636`)
- Removed the ``center`` keyword in :meth:`DataFrame.expanding` (:issue:`20647`)
Expand Down
24 changes: 0 additions & 24 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5905,30 +5905,6 @@ def _get_values_for_loc(self, series: Series, loc, key):

return series.iloc[loc]

@final
def set_value(self, arr, key, value) -> None:
"""
Fast lookup of value from 1-dimensional ndarray.

.. deprecated:: 1.0

Notes
-----
Only use this if you know what you're doing.
"""
warnings.warn(
(
"The 'set_value' method is deprecated, and "
"will be removed in a future version."
),
FutureWarning,
stacklevel=find_stack_level(),
)
loc = self._engine.get_loc(key)
if not can_hold_element(arr, value):
raise ValueError
arr[loc] = value

_index_shared_docs[
"get_indexer_non_unique"
] = """
Expand Down
8 changes: 0 additions & 8 deletions pandas/tests/indexes/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,14 +813,6 @@ def test_is_monotonic_incomparable(self, attr):
index = Index([5, datetime.now(), 7])
assert not getattr(index, attr)

def test_set_value_deprecated(self, simple_index):
# GH 28621
idx = simple_index
arr = np.array([1, 2, 3])
with tm.assert_produces_warning(FutureWarning):
idx.set_value(arr, idx[1], 80)
assert arr[1] == 80

@pytest.mark.parametrize("values", [["foo", "bar", "quux"], {"foo", "bar", "quux"}])
@pytest.mark.parametrize(
"index,expected",
Expand Down