Skip to content

REGR: fix return class in _constructor_from_mgr for simple subclasses #55764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prev Previous commit
Next Next commit
Update pandas/core/frame.py
Co-authored-by: Isaac Virshup <ivirshup@gmail.com>
  • Loading branch information
jorisvandenbossche and ivirshup authored Nov 8, 2023
commit 885aadb9e413158c77ac891da89e01ed77c2fc5c
2 changes: 1 addition & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ def _sliced_from_mgr(self, mgr, axes) -> Series:
return Series._from_mgr(mgr, axes)

def _constructor_sliced_from_mgr(self, mgr, axes):
if type(self) is DataFrame:
if self._constructor_sliced is Series:
ser = self._sliced_from_mgr(mgr, axes)
ser._name = None # caller is responsible for setting real name
return ser
Expand Down