Pass list as rowname_col
parameter
#512
Replies: 2 comments 1 reply
-
@abdullahau , thanks for bringing up this discussion. Personally, I believe it’s possible to make some modifications to import polars as pl
from great_tables import GT
df = pl.DataFrame({"foo": [1, 2, 3], "bar": [3, 2, 1], "ham": [7, 8, 9]})
corr_matrix = df.corr().with_columns(pl.Series(df.columns).alias("index"))
(GT(corr_matrix, rowname_col="index")) |
Beta Was this translation helpful? Give feedback.
1 reply
-
I'll close the discussion since the issue appears to be resolved. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I was trying to create the correlation matrix from a Polars dataframe. Unlike Pandas, the .corr() method does not create an index where the column names appear on each row of the matrix. Is there a way to pass lists instead of column references for rowname? I could see this being really helpful while using Polars
Here is my workaround:
If you have suggestions for improvement, please let me know.
Beta Was this translation helpful? Give feedback.
All reactions