Skip to content

Commit 05c715f

Browse files
committed
Use observed=True in groupby
1 parent d4a7c32 commit 05c715f

File tree

1 file changed

+3
-1
lines changed
  • packages/python/plotly/plotly/express

1 file changed

+3
-1
lines changed

Diff for: packages/python/plotly/plotly/express/_core.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -2042,7 +2042,9 @@ def get_groups_and_orders(args, grouper):
20422042
groups = {tuple(single_group_name): df}
20432043
else:
20442044
required_grouper = [g for g in grouper if g != one_group]
2045-
grouped = df.groupby(required_grouper, sort=False) # skip one_group groupers
2045+
grouped = df.groupby(
2046+
required_grouper, sort=False, observed=True
2047+
) # skip one_group groupers
20462048
group_indices = grouped.indices
20472049
sorted_group_names = [
20482050
g if len(required_grouper) != 1 else (g,) for g in group_indices

0 commit comments

Comments
 (0)