Skip to content

CLN remove 'import pandas as pd' from pandas/core/generic.py #39152

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

Conversation

MarcoGorelli
Copy link
Member

@MarcoGorelli MarcoGorelli commented Jan 13, 2021

  • Ensure all linting tests pass, see here for how to run them

will do the rest (excluding pandas/tests) and add a check if this is the kind of thing we want

Comment on lines +5307 to +5310
if isinstance(self, ABCSeries):
func = self._constructor
else:
func = self._constructor_sliced
Copy link
Member Author

Choose a reason for hiding this comment

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

Or is it better to import Series within this function so as to avoid an if-else block?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah you can just import Series here

Copy link
Contributor

Choose a reason for hiding this comment

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

the only reason you woul want this is to handle a subclass

Copy link
Contributor

Choose a reason for hiding this comment

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

but i guess this is ok

@jbrockmendel
Copy link
Member

nice

@jreback jreback added the Code Style Code style, linting, code_checks label Jan 14, 2021
@jreback jreback added this to the 1.3 milestone Jan 14, 2021
@jreback jreback merged commit 37d9a17 into pandas-dev:master Jan 14, 2021
@jreback
Copy link
Contributor

jreback commented Jan 14, 2021

thanks @MarcoGorelli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants