Continue working with the Polars library while being able to color and style the table
Since the Polars library was released in 2022, it has rapidly gained popularity due to being an ultra-speed DataFrame library. Compared with Pandas, the white bear was tested and proved to be way faster. According to the official Polars website, it is claimed to reach more than 30x performance gains.
However, nothing is perfect. The Polars library seems to have some limits.
When it comes to styling tables, Polars offers fewer options while Pandas has a built-in styler available. If you want to color a Polars DataFrame, a straightforward solution is converting the table into Pandas.
But wait… what if some code needed to be run later?
This means we have to run Pandas which can result in a drastically slower speed. Another choice is converting the table back to Polars after styling. Then, if we want to style the result, the same process has to be repeated. Even though these solutions work, they are quite inconvenient.