@@ -215,7 +215,7 @@ class Index(IndexOpsMixin, PandasObject):
215
215
_deprecations : FrozenSet [str ] = (
216
216
PandasObject ._deprecations
217
217
| IndexOpsMixin ._deprecations
218
- | frozenset (["contains" , "get_values" , " set_value" ])
218
+ | frozenset (["contains" , "set_value" ])
219
219
)
220
220
221
221
# To hand over control to subclasses
@@ -3753,21 +3753,18 @@ def _values(self) -> Union[ExtensionArray, ABCIndexClass, np.ndarray]:
3753
3753
"""
3754
3754
return self ._data
3755
3755
3756
- def get_values (self ):
3756
+ def _internal_get_values (self ):
3757
3757
"""
3758
3758
Return `Index` data as an `numpy.ndarray`.
3759
3759
3760
- .. deprecated:: 0.25.0
3761
- Use :meth:`Index.to_numpy` or :attr:`Index.array` instead.
3762
-
3763
3760
Returns
3764
3761
-------
3765
3762
numpy.ndarray
3766
3763
A one-dimensional numpy array of the `Index` values.
3767
3764
3768
3765
See Also
3769
3766
--------
3770
- Index.values : The attribute that get_values wraps.
3767
+ Index.values : The attribute that _internal_get_values wraps.
3771
3768
3772
3769
Examples
3773
3770
--------
@@ -3780,33 +3777,24 @@ def get_values(self):
3780
3777
a 1 2 3
3781
3778
b 4 5 6
3782
3779
c 7 8 9
3783
- >>> df.index.get_values ()
3780
+ >>> df.index._internal_get_values ()
3784
3781
array(['a', 'b', 'c'], dtype=object)
3785
3782
3786
3783
Standalone `Index` values:
3787
3784
3788
3785
>>> idx = pd.Index(['1', '2', '3'])
3789
- >>> idx.get_values ()
3786
+ >>> idx._internal_get_values ()
3790
3787
array(['1', '2', '3'], dtype=object)
3791
3788
3792
3789
`MultiIndex` arrays also have only one dimension:
3793
3790
3794
3791
>>> midx = pd.MultiIndex.from_arrays([[1, 2, 3], ['a', 'b', 'c']],
3795
3792
... names=('number', 'letter'))
3796
- >>> midx.get_values ()
3793
+ >>> midx._internal_get_values ()
3797
3794
array([(1, 'a'), (2, 'b'), (3, 'c')], dtype=object)
3798
- >>> midx.get_values ().ndim
3795
+ >>> midx._internal_get_values ().ndim
3799
3796
1
3800
3797
"""
3801
- warnings .warn (
3802
- "The 'get_values' method is deprecated and will be removed in a "
3803
- "future version. Use '.to_numpy()' or '.array' instead." ,
3804
- FutureWarning ,
3805
- stacklevel = 2 ,
3806
- )
3807
- return self ._internal_get_values ()
3808
-
3809
- def _internal_get_values (self ):
3810
3798
return self .values
3811
3799
3812
3800
@Appender (IndexOpsMixin .memory_usage .__doc__ )
0 commit comments