lovuikeng
lovuikeng•4w ago

(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:
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
Jump to solution
8 Replies
Hall
Hall•4w ago
Someone will reply to you shortly. In the meantime, this might help:
eugene
eugene•4w ago
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
lovuikeng
lovuikengOP•4w ago
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 🙂
Solution
eugene
eugene•4w ago
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
lovuikeng
lovuikengOP•4w ago
appreciate the response, that's helpful to know 🙂
lovuikeng
lovuikengOP•4w ago
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
eugene
eugene•4w ago
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 💙
lovuikeng
lovuikengOP•4w ago
that'd be great, thank you!

Did you find this page helpful?