Ok so after seeing and experiencing a lot of performance comparison between Pandas and Polars, I'm convinced to move to Polars.
The thing is that when using Spyder IDE to print the DataFrames, the following happens:
- In Pandas the DataFrame conveniently breaks down into new lines when there are many columns - 1st image below.
- In Polars the DataFrame starts to mess up when there are many columns - 2nd image below.
After a lot of search I guess Spyder IPython's Console does not offer a horizontal scroll bar, and Polars Config.set_* methods don't have a specific method to handle print options.
Considering that I need to print these many columns and resizing the Spyder's panes to the right/left of the interface by placing the mouse on the vertical separator is not enought, is there any workaround?
Codes:
import pandas as pd
import polars as pl
df_pd = pd.DataFrame(
{
'Extensive_Column_Name_01': [i for i in range(10)],
'Extensive_Column_Name_02': [i for i in range(10)],
'Extensive_Column_Name_03': [i for i in range(10)],
'Extensive_Column_Name_04': [i for i in range(10)],
'Extensive_Column_Name_05': [i for i in range(10)]
}
)
print(df_pd)
df_pl = pl.DataFrame(
{
'Extensive_Column_Name_01': [i for i in range(10)],
'Extensive_Column_Name_02': [i for i in range(10)],
'Extensive_Column_Name_03': [i for i in range(10)],
'Extensive_Column_Name_04': [i for i in range(10)],
'Extensive_Column_Name_05': [i for i in range(10)]
}
)
print(df_pl)