Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cdae77c

Browse files
possible fix
1 parent 35dbbe8 commit cdae77c

File tree

1 file changed

+6
-2
lines changed
  • packages/python/plotly/plotly/express

1 file changed

+6
-2
lines changed

‎packages/python/plotly/plotly/express/_core.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,7 +1939,7 @@ def get_groups_and_orders(args, grouper):
19391939
groups = {tuple(single_group_name): df}
19401940
else:
19411941
grouped = df.groupby(grouper, sort=False)
1942-
group_indices = grouped.groups
1942+
group_indices = grouped.indices
19431943
sorted_group_names = [g if len(grouper) != 1 else (g,) for g in group_indices]
19441944

19451945
for i, col in reversed(list(enumerate(grouper))):
@@ -1951,7 +1951,9 @@ def get_groups_and_orders(args, grouper):
19511951
else -1,
19521952
)
19531953

1954-
groups = {s: grouped.get_group(s) for s in sorted_group_names}
1954+
groups = {
1955+
s: grouped.get_group(s if len(s) > 1 else s[0]) for s in sorted_group_names
1956+
}
19551957
return groups, orders
19561958

19571959

@@ -2218,6 +2220,8 @@ def make_figure(args, constructor, trace_patch=None, layout_patch=None):
22182220
fig.update_layout(layout_patch)
22192221
if "template" in args and args["template"] is not None:
22202222
fig.update_layout(template=args["template"], overwrite=True)
2223+
for f in frame_list:
2224+
f["name"] = str(f["name"])
22212225
fig.frames = frame_list if len(frames) > 1 else []
22222226

22232227
if args.get("trendline") and args.get("trendline_scope", "trace") == "overall":

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /