New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to reference data from index (of pandas dataframes) #3331
Comments
Thanks for the suggestion. I see that it's easier to not have to write For this to work, Altair would need to know when the index is used and when it isn't so it can call In short, I think it adds a lot of complexity to make this work and it would only work with VegaFusion which is an additional dependency. I'll leave this open in case I'm missing something. |
Also see https://stackoverflow.com/questions/20084487/use-index-in-pandas-to-plot-data
|
It's always good to get inputs how other people use the library. Where do you see the downside of simply doing
We need the index as a proper column in the dataframe as Altair then needs to convert the Pandas dataframe to JSON (via a dictionary representation with
Yep we could use this: Call
It's very tricky to parse all expressions as they can appear in many places. Right now, this requires
We could do that but it feels easier to just let a user do
Same reason as with the first suggestion, we need it as a column in the dataset. This is a requirement for generating the Vega-Lite specification (JSON). |
"By design Altair only accesses dataframe columns, not dataframe indices":
https://altair-viz.github.io/user_guide/data.html#including-index-data
Please consider to support indexed pandas dataframes in a future altair version. Also see
https://stackoverflow.com/questions/77993730/how-to-use-indexed-data-frames-with-altair/
The text was updated successfully, but these errors were encountered: