Skip to content
This repository was archived by the owner on Oct 23, 2025. It is now read-only.

Sourcery Starbot ⭐ refactored regonn/polar_bear#8

Open
SourceryAI wants to merge 1 commit intoregonn:masterfrom
SourceryAI:master
Open

Sourcery Starbot ⭐ refactored regonn/polar_bear#8
SourceryAI wants to merge 1 commit intoregonn:masterfrom
SourceryAI:master

Conversation

@SourceryAI
Copy link
Copy Markdown

Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨

Here's your pull request refactoring your most popular Python repo.

If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch https://github.com/sourcery-ai-bot/polar_bear master
git merge --ff-only FETCH_HEAD
git reset HEAD^

if dtype in float_dtype_list:
return 'numerical'
if (dtype == 'bool') or (dtype == 'object'):
if dtype in ['bool', 'object']:
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function _detect_type refactored with the following changes:

  • Replace multiple comparisons of same variable with in operator (merge-comparisons)

droped_values = list(chain.from_iterable(
pd.Series(row).dropna().str.split(split).to_list()))
if len(droped_values) == 0:
if not droped_values:
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function convert_multi_category refactored with the following changes:

  • Simplify sequence comparison (simplify-len-comparison)

series[np.isnan(series)] = mean
return_df[series.name + "_float"] = series
elif (dtype == 'object') or (dtype == 'bool'):
elif dtype in ['object', 'bool']:
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function convert_series refactored with the following changes:

  • Replace multiple comparisons of same variable with in operator (merge-comparisons)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant