Skip to content

CLN: remove the circular import in NDFrame.dtypes #35128

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

Merged
merged 1 commit into from
Jul 7, 2020
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
5 changes: 2 additions & 3 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5366,9 +5366,8 @@ def dtypes(self):
string object
dtype: object
"""
from pandas import Series # noqa: F811

return Series(self._mgr.get_dtypes(), index=self._info_axis, dtype=np.object_)
data = self._mgr.get_dtypes()
return self._constructor_sliced(data, index=self._info_axis, dtype=np.object_)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this overriden by Series?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is in frame.py -

_constructor_sliced: Type[Series] = Series

And for Series the dtypes property is overridden


def _to_dict_of_blocks(self, copy: bool_t = True):
"""
Expand Down