-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Added missing import in boxplot_frame_groupby example #34343
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
Added missing import in boxplot_frame_groupby example #34343
Conversation
Thanks @gsyqax - did you build this page of the documentation locally to check it works? |
5c3b913
to
f81fb81
Compare
@MarcoGorelli yes, it is working. I noticed the example also makes use of 'pd' and 'np' alias without importing and aliasing pandas and numpy. I don't think this can lead to confusion. Do you think I should also add those imports? |
That's OK, it fits with the docstring guide
|
I just tried building it with your changes and I don't see any plot though, do you? See the guide I linked to above for how to display plots in documentation examples |
I'm not seeing any plots either. I thought a plot was not needed since the current version is not showing any either. I will add the plots and commit again |
855448d
to
28da625
Compare
@MarcoGorelli I added some plots and made a few minor changes to make everything clearer, hope it's OK. Also removed whitespace as indicated by pep8speaks. |
28da625
to
cda5819
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks, just tried running it and it looks good. Can you just add a space between the two examples, as suggested below?
Also, I don't think a whatsnew note is necessary for documentation improvements, could you please revert that change? |
Co-authored-by: Marco Gorelli <33491632+MarcoGorelli@users.noreply.github.com>
bc906d5
to
d0b1e16
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
have opened #34353 as I'm not sure what to do about the subplots being too close (but it would warrant a separate PR anyway, I don't think there'd be any need to change that here)
Great! Many thanks @MarcoGorelli for all the help, really appreciate it! |
try it will avoid having overlapped subplots and make doc look better |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we should not advertise boxplot_frame_groupby
like that directly, but rather as df.groupby(..).boxplot(..)
Slight preference for what @jorisvandenbossche has suggested above but not a blocker so OK either way |
I applied the change to the plot fig size and replaced boxplot_frame_groupby by df.groupby.boxplot. I'm keeping the intermediate var 'grouped' to make things easier to read |
pandas/plotting/_core.py
Outdated
:context: close-figs | ||
|
||
>>> import itertools | ||
>>> from pandas.plotting import boxplot_frame_groupby |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gsyqax can you remove this import.
lgtm. @TomAugspurger |
Thanks @gsyqax! |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff