Replies: 1 comment 2 replies
-
The fixes you're asking for come from Pandas's styling of data frames. That would be the right place to fix them. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
The python "standard" way to (HTML) render a structured text file
I know, there is no "standard" way. But perhaps the most common way to start is to create a pandas dataframe and then render it.
If I have in example this CSV input file
I can write this
to get in quarto this standard output
What don't I like? Quarto is a really impressive scientific and technical publishing system. I know that even these are not general rules, but in my opinion there should be a way to have a default output that:
And if I am doing a scientific/journalistic web publication in Italian, things get a little worse, because there is no direct way to say "we are in Italy, use Italian conventions for numbers, and use the
,
as decimal separator and.
as thousand separator".A way to do it, without using some other python libraries, is to write some code like this
to get
I love the observable "default" output. If I write
I get
Some notes about this default output:
5789.56569
.Moreover if I want Italian localization I can modify the code in this way
to get
,
as decimal separator and.
as thousand separator.I know that a great way to have it will be to use great-tables and this kind of code
but right now I have some problems with it, using
locale
parameter and with the default table rendering in Quarto 1.4.I have been long, because it seems to me to be a topic of general interest, and because this long introduction was necessary to arrive at my proposal/reflection.
I know that the output here depends on pandas, but I also know that here quarto is the engine that will generate the scientific report.
I think there should be a possibility to tell to quarto: "use the standard way of rendering a table, applying the number formatting used in this country".
Could be additional yaml parameters:
Or without having a "standard" to define these individually
Clearly there must also be the possibility of not only defining it globally for the entire document, but also differently for each table in the document. But that is not the most important thing for now.
What do you think? Have I just written nonsense and is there already a ready-made way to do this?
I have a small working example in this page of this repo.
Thank you
Beta Was this translation helpful? Give feedback.
All reactions