@@ -96,63 +96,36 @@ def test_dataframe_groupby_quantile(scalars_df_index, scalars_pandas_df_index, q
9696
9797
9898@pytest .mark .parametrize (
99- ("na_option" , "method" , "ascending" ),
99+ ("na_option" , "method" , "ascending" , "pct" ),
100100 [
101101 (
102102 "keep" ,
103103 "average" ,
104104 True ,
105- ),
106- (
107- "top" ,
108- "min" ,
109- False ,
110- ),
111- (
112- "bottom" ,
113- "max" ,
114- False ,
115- ),
116- (
117- "top" ,
118- "first" ,
119- False ,
120- ),
121- (
122- "bottom" ,
123- "dense" ,
124105 False ,
125106 ),
107+ ("top" , "min" , False , False ),
108+ ("bottom" , "max" , False , False ),
109+ ("top" , "first" , False , True ),
110+ ("bottom" , "dense" , False , True ),
126111 ],
127112)
128113def test_dataframe_groupby_rank (
129- scalars_df_index ,
130- scalars_pandas_df_index ,
131- na_option ,
132- method ,
133- ascending ,
114+ scalars_df_index , scalars_pandas_df_index , na_option , method , ascending , pct
134115):
135116 # TODO: supply a reason why this isn't compatible with pandas 1.x
136117 pytest .importorskip ("pandas" , minversion = "2.0.0" )
137118 col_names = ["int64_too" , "float64_col" , "int64_col" , "string_col" ]
138119 bf_result = (
139120 scalars_df_index [col_names ]
140121 .groupby ("string_col" )
141- .rank (
142- na_option = na_option ,
143- method = method ,
144- ascending = ascending ,
145- )
122+ .rank (na_option = na_option , method = method , ascending = ascending , pct = pct )
146123 ).to_pandas ()
147124 pd_result = (
148125 (
149126 scalars_pandas_df_index [col_names ]
150127 .groupby ("string_col" )
151- .rank (
152- na_option = na_option ,
153- method = method ,
154- ascending = ascending ,
155- )
128+ .rank (na_option = na_option , method = method , ascending = ascending , pct = pct )
156129 )
157130 .astype ("float64" )
158131 .astype ("Float64" )
@@ -737,63 +710,51 @@ def test_series_groupby_agg_list(scalars_df_index, scalars_pandas_df_index):
737710
738711
739712@pytest .mark .parametrize (
740- ("na_option" , "method" , "ascending" ),
713+ ("na_option" , "method" , "ascending" , "pct" ),
741714 [
742- (
743- "keep" ,
744- "average" ,
745- True ,
746- ),
715+ ("keep" , "average" , True , False ),
747716 (
748717 "top" ,
749718 "min" ,
750719 False ,
720+ True ,
751721 ),
752722 (
753723 "bottom" ,
754724 "max" ,
755725 False ,
726+ True ,
756727 ),
757728 (
758729 "top" ,
759730 "first" ,
760731 False ,
732+ True ,
761733 ),
762734 (
763735 "bottom" ,
764736 "dense" ,
765737 False ,
738+ False ,
766739 ),
767740 ],
768741)
769742def test_series_groupby_rank (
770- scalars_df_index ,
771- scalars_pandas_df_index ,
772- na_option ,
773- method ,
774- ascending ,
743+ scalars_df_index , scalars_pandas_df_index , na_option , method , ascending , pct
775744):
776745 # TODO: supply a reason why this isn't compatible with pandas 1.x
777746 pytest .importorskip ("pandas" , minversion = "2.0.0" )
778747 col_names = ["int64_col" , "string_col" ]
779748 bf_result = (
780749 scalars_df_index [col_names ]
781750 .groupby ("string_col" )["int64_col" ]
782- .rank (
783- na_option = na_option ,
784- method = method ,
785- ascending = ascending ,
786- )
751+ .rank (na_option = na_option , method = method , ascending = ascending , pct = pct )
787752 ).to_pandas ()
788753 pd_result = (
789754 (
790755 scalars_pandas_df_index [col_names ]
791756 .groupby ("string_col" )["int64_col" ]
792- .rank (
793- na_option = na_option ,
794- method = method ,
795- ascending = ascending ,
796- )
757+ .rank (na_option = na_option , method = method , ascending = ascending , pct = pct )
797758 )
798759 .astype ("float64" )
799760 .astype ("Float64" )
0 commit comments