Skip to content
Merged
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
4 changes: 2 additions & 2 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -9244,7 +9244,7 @@ def _tz_convert(ax, tz):
raise ValueError(f"The level {level} is not valid")
ax = _tz_convert(ax, tz)

result = self._constructor(self._data, copy=copy)
result = self.copy(deep=copy)
result = result.set_axis(ax, axis=axis, inplace=False)
return result.__finalize__(self)

Expand Down Expand Up @@ -9413,7 +9413,7 @@ def _tz_localize(ax, tz, ambiguous, nonexistent):
raise ValueError(f"The level {level} is not valid")
ax = _tz_localize(ax, tz, ambiguous, nonexistent)

result = self._constructor(self._data, copy=copy)
result = self.copy(deep=copy)
result = result.set_axis(ax, axis=axis, inplace=False)
return result.__finalize__(self)

Expand Down