File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
packages/python/plotly/plotly/express Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1938,7 +1938,8 @@ def get_groups_and_orders(args, grouper):
19381938 # we have a single group, so we can skip all group-by operations!
19391939 groups = {tuple (single_group_name ): df }
19401940 else :
1941- group_indices = df .groupby (grouper , sort = False ).indices
1941+ grouped = df .groupby (grouper , sort = False )
1942+ group_indices = grouped .indices
19421943 sorted_group_names = [g if len (grouper ) != 1 else (g ,) for g in group_indices ]
19431944
19441945 for i , col in reversed (list (enumerate (grouper ))):
@@ -1950,7 +1951,7 @@ def get_groups_and_orders(args, grouper):
19501951 else - 1 ,
19511952 )
19521953
1953- groups = {s : df . iloc [ group_indices [ s ]] for s in sorted_group_names }
1954+ groups = {s : grouped . get_group ( s ) for s in sorted_group_names }
19541955 return groups , orders
19551956
19561957
You can’t perform that action at this time.
0 commit comments