Skip to content

DOC: update style.ipynb for 2.0 #50973

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

Merged
merged 7 commits into from
Feb 9, 2023

Conversation

attack68
Copy link
Contributor

This PR tries to frame Styler more as a general display output tool, by including the more generalist "formatting" functions at the start,

Screenshot 2023-01-25 at 20 10 11
Screenshot 2023-01-25 at 20 10 29

@mroeschke mroeschke added Docs Styler conditional formatting using DataFrame.style labels Jan 25, 2023
@mroeschke
Copy link
Member

nbclient.exceptions.CellExecutionError: An error occurred while executing the following cell:
------------------
df = pd.DataFrame({
    "strings": ["Adam", "Mike"],
    "ints": [1, 3],
    "floats": [1.123, 1000.23]
})
df.style \
  .format(precision=3, thousands=".", decimal=",") \
  .format_index(str.upper, axis=1) \
  .relabel_index(["row 1", "row 2"], axis=0)
------------------

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[1], line 1
----> 1 df = pd.DataFrame({
      2     "strings": ["Adam", "Mike"],
      3     "ints": [1, 3],
      4     "floats": [1.123, 1000.23]
      5 })
      6 df.style \
      7   .format(precision=3, thousands=".", decimal=",") \
      8   .format_index(str.upper, axis=1) \
      9   .relabel_index(["row 1", "row 2"], axis=0)

NameError: name 'pd' is not defined
NameError: name 'pd' is not defined

Notebooks DONE

@mroeschke mroeschke added this to the 2.0 milestone Feb 9, 2023
@mroeschke mroeschke merged commit 4510c6f into pandas-dev:main Feb 9, 2023
@mroeschke
Copy link
Member

Thanks @attack68

@attack68 attack68 deleted the styler_user_guide_20 branch February 15, 2023 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Styler conditional formatting using DataFrame.style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants