You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of Polars.
Issue description
The wrong default table format for Linux. Set pl.Config.set_tbl_formatting when importing.
Solution:
A general solution for differentiating the os systems is here:
if sys.platform.startswith("linux"): # could be "linux", "linux2", "linux3", ...
# linux
elif sys.platform == "darwin":
# MAC OS X
elif os.name == "nt":
# Windows, Cygwin, etc. (either 32-bit or 64-bit)
I suggest the code below be implemented every time when printing a data frame or just one time when importing Polars (which would be ideal, it would run only once. But any solution is okay since the runtime is minimal). I'm also reproducing the time to run this code to prove that the time is negligible. The packages are all from Python Standard Library (built-in packages).
Here is what I suggest:
if sys.platform.startswith("linux"): # could be "linux", "linux2", "linux3", ...
pl.Config.set_ascii_tables(True)
I also mention similar problem in #5942 for changing the default format.
arturdaraujo
changed the title
Solution for checking system OS to accurately printing polars DataFrame.
Solution for checking system OS to accurately printing polars DataFrame format.
Dec 29, 2022
Polars version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of Polars.
Issue description
The wrong default table format for Linux. Set pl.Config.set_tbl_formatting when importing.
Solution:
A general solution for differentiating the os systems is here:
I suggest the code below be implemented every time when printing a data frame or just one time when importing Polars (which would be ideal, it would run only once. But any solution is okay since the runtime is minimal). I'm also reproducing the time to run this code to prove that the time is negligible. The packages are all from Python Standard Library (built-in packages).
Here is what I suggest:
I also mention similar problem in #5942 for changing the default format.
References:
Reproducible example
Expected behavior
Installed versions
The text was updated successfully, but these errors were encountered: