Get help from the marimo community

Updated last month

(Data explorer) DatetimeIndex column not available in encodings selection

At a glance

The community member is trying to use the data explorer with a pandas dataframe that has a DatetimeIndex, but they are unable to see the index column in the encodings dropdowns. Another community member suggests using mo.ui.data_explorer(df.reset_index()) to make the index column visible.

The community members discuss the challenges of performing operations like rolling on the datetime column using the data explorer, as it supports both pandas and polars dataframes, and their APIs for such operations may differ. They suggest that the data explorer is primarily for exploratory data analysis, and for more advanced operations, using mo.ui.dataframe directly may be more suitable. One community member suggests adding rolling as a transform method to mo.ui.dataframe.

while trying to use data explorer with dataframe of DatetimeIndex, looking to do rolling on the DatetimeIndex column, but not seeing the index column in encodings dropdowns
e
l
8 comments
Hi, I'm afraid the index column of a pandas dataframe won't be recognized as a regular column in the data explorer.
Meanwhile, you can use mo.ui.data_explorer(df.reset_index()) and the index column should appear in encodings dropdowns
good idea πŸ™‚ one thing, how do i do rolling on datetime column using data explorer?
using altair directly works too, would be great if can do the same with data explorer πŸ™‚
I think the problem might be with that, data explorer is for both pandas and polars dataframe, but their api of rolling is not exactly the same, so supporting such operations in data explorer is tricky
appreciate the response, that's helpful to know πŸ™‚
going to try more of data explorer, new to the field of data science, really appreciate the work of marimo to make the learning experience both fun and productive
Actually, I think all dataframes are internally transformed to panda dataframe in the data explorer if they are not, so it's not the reason 🫠

But data explorer is mainly used for graphical exploratory data analysis i suppose, so transforms like rolling are unavailable in data explorer.

For such operations, maybe mo.ui.dataframe is better and you can output the result of it (like some rolling) to the data explorer.

I think rolling should be added to mo.ui.dataframe as a transform method, thanks for your suggestion πŸ’™
that'd be great, thank you!
Add a reply
Sign up and join the conversation on Discord