Open MarcSkovMadsen opened 10 hours ago
An implementation for this would be rather expensive as the crate we use for formatting doesn't allow for this. And it is not something that is our priority of getting efficient.
Given that, I would recommend to use the engine to create the floats you want:
import polars.selectors as cs
pl.DataFrame({
"a": [1.223, 12.443]
}).with_columns(cs.float().cast(pl.String).str.replace(".", ",", literal=True)).write_csv(..)
Description
Hi. I'm currently working on copy-paste functionality for HoloViz Panel in https://github.com/awesome-panel/panel-copy-paste.
I would like to be able to convert a Polars dataframe to tab separated
\t
csv strings and add them to the users clipboard for easy insertion into for example excel spreadsheets. I and some of my users are using Europeandecimal_separator
"," in Excel.Please add option to use
decimal_seperator
"," inwrite_csv
similarly to pandasdecimal
argument into_csv
.Thanks.
Workaround
Convert to pandas