@@ -1916,10 +1916,17 @@ def get_orderings(args, grouper, grouped, all_same_group):
1916
1916
of a single dimension-group
1917
1917
"""
1918
1918
orders = {} if "category_orders" not in args else args ["category_orders" ].copy ()
1919
+ sorted_group_names = []
1919
1920
1920
1921
if all_same_group :
1921
- sorted_group_names = [("" ,) * len (grouper )]
1922
- return orders , sorted_group_names
1922
+ for col in grouper :
1923
+ if col != one_group :
1924
+ single_val = args ["data_frame" ][col ].iloc [0 ]
1925
+ sorted_group_names .append (single_val )
1926
+ orders [col ] = [single_val ]
1927
+ else :
1928
+ sorted_group_names .append ("" )
1929
+ return orders , [tuple (sorted_group_names )]
1923
1930
1924
1931
for col in grouper :
1925
1932
if col != one_group :
@@ -1929,7 +1936,6 @@ def get_orderings(args, grouper, grouped, all_same_group):
1929
1936
else :
1930
1937
orders [col ] = list (OrderedDict .fromkeys (list (orders [col ]) + uniques ))
1931
1938
1932
- sorted_group_names = []
1933
1939
for group_name in grouped .groups :
1934
1940
if len (grouper ) == 1 :
1935
1941
group_name = (group_name ,)
0 commit comments