You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some places where Altair currently requires a list or an array to be passed and doesn't accept e.g. a pandas index, although this can easily be converted to a list or an array. The errors from this can sometimes be confusing so I suggest that we are more lenient and at least allow passing pandas Indices by converting them to lists automatically. Optionally, we can convert any data structure that has a tolist() method.
In this example the error is quite helpful, although still a bit confusing since indexes and arrays are often uses interchangeable when working with pandas directly
SchemaValidationError: Invalid specification
altair.vegalite.v5.schema.core.BindRadioSelect->options, validating 'type'
{0: 'Miles_per_Gallon', 406: 'Displacement', 812: 'Weight_in_lbs', 1218: 'Acceleration'} is not of type 'array'
In other cases, such as the one below, the traceback is huge and the error message is not at all helpful
This sounds great to me @joelostblom. I come across this fairly frequently. (I just looked up an example, and in my case, I was getting the index from something like df.groupby(...).median().sort_values().index.)
Ah yes that definitely happens to me as well when sorting boxplots since they don't support the usual sorting values. Feel free to work on this if you want, I haven't looked into this so I don't have a good idea of where to start and have some other commitments for the next few days.
There are some places where Altair currently requires a list or an array to be passed and doesn't accept e.g. a pandas index, although this can easily be converted to a list or an array. The errors from this can sometimes be confusing so I suggest that we are more lenient and at least allow passing pandas Indices by converting them to lists automatically. Optionally, we can convert any data structure that has a
tolist()
method.In this example the error is quite helpful, although still a bit confusing since indexes and arrays are often uses interchangeable when working with pandas directly
In other cases, such as the one below, the traceback is huge and the error message is not at all helpful
The text was updated successfully, but these errors were encountered: