Skip to content

remove comparison of identical variables #18036

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

Closed
wants to merge 2 commits into from
Closed

remove comparison of identical variables #18036

wants to merge 2 commits into from

Conversation

sophsoph321
Copy link
Contributor

Reference Issues/PRs

Fixes #12167

What does this implement/fix? Explain your changes.

remove comparison of identical variables in sklearn/externals/_arff.py

Any other comments?

@sophsoph321
Copy link
Contributor Author

remove Variable defined multiple times in examples/linear_model/plot_poisson_regression_non_normal_loss.py

@glemaitre
Copy link
Member

glemaitre commented Jul 30, 2020

The arff package is an external package and your changes should be contributed there: https://github.com/renatopp/liac-arff
I would not be surprised that value != value would be linked to detect some nan value

@TomDLT
Copy link
Member

TomDLT commented Jul 30, 2020

>>> np.nan != np.nan                                                                                      
True

@glemaitre
Copy link
Member

Thought, it would be better to use np.isnan if we expect np.nan

Copy link
Member

@rth rth left a comment

Choose a reason for hiding this comment

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

Sorry closing, as mentioned above this change should be contributed to https://github.com/renatopp/liac-arff

@@ -77,7 +77,7 @@
.format(df.loc[df["ClaimNb"] == 0, "Exposure"].sum() /
df["Exposure"].sum()))

fig, (ax0, ax1, ax2) = plt.subplots(ncols=3, figsize=(16, 4))
_, (ax0, ax1, ax2) = plt.subplots(ncols=3, figsize=(16, 4))
Copy link
Member

@rth rth Jul 31, 2020

Choose a reason for hiding this comment

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

Even here, I'm not sure it's a positive change.

fig, ax = plt.subplots(...)

is more readable than,

_, ax = ..

particularly in an example even if fig is not used.

@rth rth closed this Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Look at lgtm.com alerts for last couple of months
4 participants