Skip to content
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

Team pace ranking example #420

Merged
merged 1 commit into from
Jul 25, 2023
Merged

Conversation

Casper-Guo
Copy link
Contributor

Produce the following plot:

team_pace

@Casper-Guo
Copy link
Contributor Author

The SettingWithCopyWarning is a false positive

Can be disabled with pd.options.mode.chained_assignment = None

@theOehrly
Copy link
Owner

The SettingWithCopyWarning is a false positive

It's not really a false positive. It's complaining because .pick_quicklaps is returning a copy of race.laps. So you are not modifying the original race.laps. Which also isn't the intention here, but the warning is distracting.

I don't really want to disable the warning in pandas entirely. You'd need to explain that line of code as well then.
It would be possible to hide it (https://sphinx-gallery.github.io/stable/configuration.html#hiding-lines-of-code) but that's not really a good solution either, I think.

Maybe the best solution would be to slightly modify the example so that the problem does not occur? Is that possible without making the code much more complicated? Just don't create the column in the exisiting dataframe but keep the data as a separate variable or create a new DataFrame? What do you think?

@Casper-Guo
Copy link
Contributor Author

Should be a very simple modification, will look into it

@Casper-Guo
Copy link
Contributor Author

Got rid of the warning, everything looks decent in the build now

@theOehrly
Copy link
Owner

Yes, looks good. One minor nitpick, sphinx-gallery ignores the line breaks in the description comments. So you need to use proper punctuation there. Else, the text is not very readable. Example:

grafik

@Casper-Guo
Copy link
Contributor Author

Casper-Guo commented Jul 19, 2023

Yes I forgot that detail. I've edited all the block comments.

Just need to fix a typo

@theOehrly
Copy link
Owner

All good now, in my opinion. I can merge this? Or is there anything you want to change still? I'm a bit confused by your comment about the typo 😅

@Casper-Guo
Copy link
Contributor Author

Ah sorry I forgot to update the comment after my last push. Everything ready to merge now.

@theOehrly theOehrly merged commit 5ea721c into theOehrly:master Jul 25, 2023
7 checks passed
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.

2 participants