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
.venv/lib/python3.12/site-packages/plotly/express/_core.py:2065: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
sf: grouped.get_group(s if len(s) > 1 else s[0])
I can suppress the warning by fixing a line in get_groups_and_orders()
sf: grouped.get_group(s if len(s) > 1 else s[0])
to
sf: grouped.get_group(s if len(s) > 1 else (s[0], ))
In my case, this only happens when I include color, which seems to trigger the grouping by tuple:
This doesn't work: fig = px.bar(main_df, x='role', y='count', color='role')
This works: fig = px.bar(main_df, x='role', y='count')
The text was updated successfully, but these errors were encountered:
Using
plotly==5.18.0
andpandas==2.2.0
.I get the following
FutureWarning
I can suppress the warning by fixing a line in
get_groups_and_orders()
sf: grouped.get_group(s if len(s) > 1 else s[0])
to
sf: grouped.get_group(s if len(s) > 1 else (s[0], ))
In my case, this only happens when I include color, which seems to trigger the grouping by tuple:
This doesn't work:
fig = px.bar(main_df, x='role', y='count', color='role')
This works:
fig = px.bar(main_df, x='role', y='count')
The text was updated successfully, but these errors were encountered: