probabl-ai / skore

Skore let's you "Own Your Data Science." It provides a user-friendly interface to track and visualize your modeling results, and perform evaluation of your machine learning models with scikit-learn.
https://probabl.ai
MIT License
11 stars 0 forks source link

Dataframe display: displaying the row index #376

Open sylvaincom opened 1 week ago

sylvaincom commented 1 week ago

When displaying pandas data frames on the dashboard, I would like to have the row index (same as the column index that already appears):

Capture d’écran 2024-09-23 à 15 06 57
augustebaum commented 1 week ago

Other dataframe libraries like polars don't automatically have index columns (for example, polars has a with_row_index method) to add a column at the beginning which looks like an index column. You can achieve a similar effect for pandas with pandas.DataFrame.reset_index().

Because we eventually intend to support other kinds of DataFrames, I don't think we should make Pandas a special case, although we could at least mention the reset_index trick in our docs.

tuscland commented 5 days ago

Isn't it convenient to display the row index at all times?

tuscland commented 1 day ago

This issue boils down to detecting if a DataFrame has an index, and transmitting this index to the frontend.

sylvaincom commented 1 day ago

I am very familiar with pandas, and less with polars, but in the case of the skore UI for dashboard, I think that it would be best to display the row index by default. Indeed, in our UI, when you have a lot of rows, you must click to the right (and left) to visualize the next pack of 10 rows, making you loose sight of which row index you are at. This is not a strong opinion, and I am ok with how things currently are.

Capture d’écran 2024-09-30 à 14 33 56
augustebaum commented 7 hours ago

Yeah, it's a problem indeed. We could at least send the index over as a column when we find it.