Open chaffra opened 12 months ago
Hi,
i'm not sure we should support the .style attribute in our DataFrame component, but maybe https://solara.dev/api/display is what you want display(df) in a component should get you the same output as in the notebook. Is that want you need?
I don't know which feature from pandas Styler @chaffra wants, but in my case I would like to remove the index column or alternatively to set as index another column (in the example below the column "token ID"). Any idea on how to do that?
@alonsosilvaallende I was looking into getting a sensible first column as well. The first step I used was to set the token ID as index in pandas df = df.set_index("Token ID")
. Then the default display method of pandas will already use this column as an index instead. Solara dataframes don't support this view yet, but I saw that someone has created a pull request to support it here: #526
If you have a styled
df = pandas.DataFrame().style
, you can pass it assdf = solara.DataFrame(df.data)
but you loose the styling that was applied to df. So if columns were hidden by the styler, they are displayed again. It would be good for solara.DataFrame to reapply the style before when displaying sdf in a notebook for example.