(Data explorer) DatetimeIndex column not available in encodings selection
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
Solution:Jump to solution
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
8 Replies
Someone will reply to you shortly. In the meantime, this might help:
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 dropdownsgood 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 🙂
Solution
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!