Skip to content

Instantly share code, notes, and snippets.

@andjc
Created April 13, 2024 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andjc/95e1da80160efa972c16cd7228408182 to your computer and use it in GitHub Desktop.
Save andjc/95e1da80160efa972c16cd7228408182 to your computer and use it in GitHub Desktop.
localised_dataframe_persian.ipynb
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andjc
Copy link
Author

andjc commented Apr 13, 2024

improved display:

display(df.style.set_table_attributes('dir="rtl"').format(
    {"date": to_persian_calendar, "A": persian_numbers, "B": persian_numbers }
).relabel_index(
    ["تاریخ", "ا", "ب"], axis=1
).set_properties(**{'font-family': 'Noto Naskh Arabic','font-size': '16px'}))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment