plotnine icon indicating copy to clipboard operation
plotnine copied to clipboard

Polars support

Open brechtmann opened this issue 2 years ago • 4 comments

Polars https://www.pola.rs/ is a nice data frame library for python.

It would be great if plotnine would also support polars instead of pandas data frames.

My current workaround is:

plotnine.ggplot(polars_df.to_pandas(), plotnine.aes('...'))

brechtmann avatar Jun 28 '22 17:06 brechtmann

I suppose the sensible way here would be to check if it has a 'to_pandas' (or even a to_frame()?) method, and then convert it - I don't think plotnine should require polars support just to check for it's classes.

TyberiusPrime avatar Aug 11 '22 08:08 TyberiusPrime

polars is the future but there are still some way to go before it is viable for first class support. Though in the next release you will not have to do df.to_pandas; baby steps!

has2k1 avatar Sep 13 '22 18:09 has2k1

Was this update put in? I was using polars with plotnine and I didn't encounter an error.

zykezero avatar Oct 11 '22 16:10 zykezero

You will likely run into errors with missing data because Polars has first-class nullable types support, while Plotnine does not understand these.

Hoeze avatar Mar 14 '23 15:03 Hoeze