Skip to content

Commit d070b06

Browse files
committed
DOC: Update warning in Index.values docstring to clarify index modification issues (pandas-dev#60954) with changes
1 parent 3474043 commit d070b06

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pandas/core/indexes/base.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -4912,9 +4912,8 @@ def values(self) -> ArrayLike:
49124912
:meth:`Index.to_numpy`, depending on whether you need
49134913
a reference to the underlying data or a NumPy array.
49144914
4915-
Modifying 'Index.values' directly is not supported and can lead to memory
4916-
corruption or segmentation faults. This is because 'Index.values' provides
4917-
a direct reference to internal NumPy data.
4915+
.. versionchanged:: 3.0.0
4916+
The returned array is read-only.
49184917
49194918
Returns
49204919
-------

0 commit comments

Comments
 (0)