-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: Fixing EX01 - Added examples #54039
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
Conversation
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.
looks good to me if the preview looks good, leaving open a bit in case @attack68 has comments
>>> df.columns | ||
Index(['A', 'B'], dtype='object') |
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.
can't believe there wasn't an example for this 😄
/preview |
No preview found for PR #54039. Did the docs build complete? |
looks like the docs build is failing
|
pandas/io/formats/style.py
Outdated
... caption="My table") # doctest: +SKIP | ||
|
||
Please see: | ||
:ref:Table Visualization <../../user_guide/style.ipynb>`_ for more examples. |
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.
missing a backtick at the beginning?
:ref:`
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.
Embarrassing!
Is this my fault - I wouldn't think so but I can't be sure.
|
that's unrelated 😄 I think this one is more related
|
pandas/io/formats/style.py
Outdated
... caption="My table") # doctest: +SKIP | ||
|
||
Please see: | ||
:ref:`Table Visualization <../../user_guide/style.ipynb>`_ for more examples. |
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.
I think you don't need 'ref'
pandas/pandas/io/formats/style.py
Line 1797 in 51c6e79
See `Table Visualization <../../user_guide/style.ipynb>`_ user guide for |
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.
🥺
Could you merge in main once more here? |
/preview |
Website preview of this PR available at: https://pandas.pydata.org/preview/54039/ |
>>> path = "path/to/template" # doctest: +SKIP | ||
>>> file = "template.tpl" # doctest: +SKIP | ||
>>> EasyStyler = Styler.from_custom_template(path, file) # doctest: +SKIP | ||
>>> HTML(EasyStyler(df).to_html(table_title="Another Title")) # doctest: +SKIP |
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.
I was a bit slow here but I would have commented that the IPython import and the HTML(..)
command are unnecessary. Printing HTML and display in a Jupyter notebook would have worked regardless. These additions just obfuscate the example.
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.
thanks @attack68
cool, can we address this as part of a follow-up @DeaMariaLeon please?
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.
it might be minimalist if the path
and file
are moved into the arguments without being pre-defined.
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.
Sure @MarcoGorelli
Thanks for the review @attack68
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.
The HTML and importing IPython are also in the User Guide.
Edit: I hope my link works! and marking @MarcoGorelli in case he didn't see this last comment. It's just FYI - not a complain.
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.
The HTML and importing IPython are also in the [User Guide]
They are but are not necessary here, since these documentation examples do not render HTML.
How a user chooses to render the generated HTML produced via Object.to_html
, e.g. in a browser file, in Jupyter Notebook, in an Email or a Javascript component, is not within scope for this documentation example.
The User Guide is different. It is written in Jupyter Notebook, so the inclusions of iPython HTML is included to ensure that the correct HTML is rendered within the notebook correctly, and the only reason it is needed is because a keyword argument is passed to the to_html
.
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.
Ok that's clear. What is not clear to me is how useful my Styler examples are when there are not images at all.
Towards #37875
We need to preview here as html documents for
Styler
can't be done locally.