Skip to content

Commit 1d8922e

Browse files
authored
CLN: MultiIndex._values remove special casing for Timestamp.freq (#49559)
1 parent 85c2cb3 commit 1d8922e

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

pandas/core/indexes/multi.py

+1-11
Original file line numberDiff line numberDiff line change
@@ -732,23 +732,13 @@ def _values(self) -> np.ndarray:
732732
vals = cast("CategoricalIndex", vals)
733733
vals = vals._data._internal_get_values()
734734

735-
is_dti = isinstance(vals, ABCDatetimeIndex)
736-
737-
if is_dti:
738-
# TODO: this can be removed after Timestamp.freq is removed
739-
# The astype(object) below does not remove the freq from
740-
# the underlying Timestamps so we remove it here to match
741-
# the behavior of self._get_level_values
742-
vals = algos.take_nd(vals, codes, fill_value=index._na_value)
743-
744735
if isinstance(vals.dtype, ExtensionDtype) or isinstance(
745736
vals, (ABCDatetimeIndex, ABCTimedeltaIndex)
746737
):
747738
vals = vals.astype(object)
748739

749740
vals = np.array(vals, copy=False)
750-
if not is_dti:
751-
vals = algos.take_nd(vals, codes, fill_value=index._na_value)
741+
vals = algos.take_nd(vals, codes, fill_value=index._na_value)
752742
values.append(vals)
753743

754744
arr = lib.fast_zip(values)

0 commit comments

Comments
 (0)