@@ -789,12 +789,29 @@ def test_sum_nanops_min_count(self):
789
789
)
790
790
def test_sum_nanops_dtype_min_count (self , float_type , kwargs , expected_result ):
791
791
# GH#46947
792
- # pass
793
792
df = DataFrame ({"a" : [1.0 , 2.3 , 4.4 ], "b" : [2.2 , 3 , np .nan ]}, dtype = float_type )
794
793
result = df .sum (** kwargs )
795
794
expected = Series (expected_result ).astype (float_type )
796
795
tm .assert_series_equal (result , expected )
797
796
797
+ @pytest .mark .parametrize ("float_type" , ["float16" , "float32" , "float64" ])
798
+ @pytest .mark .parametrize (
799
+ "kwargs, expected_result" ,
800
+ [
801
+ ({"axis" : 1 , "min_count" : 2 }, [2.0 , 4.0 , np .NaN ]),
802
+ ({"axis" : 1 , "min_count" : 3 }, [np .NaN , np .NaN , np .NaN ]),
803
+ ({"axis" : 1 , "skipna" : False }, [2.0 , 4.0 , np .NaN ]),
804
+ ],
805
+ )
806
+ def test_prod_nanops_dtype_min_count (self , float_type , kwargs , expected_result ):
807
+ # GH#46947
808
+ df = DataFrame (
809
+ {"a" : [1.0 , 2.0 , 4.4 ], "b" : [2.0 , 2.0 , np .nan ]}, dtype = float_type
810
+ )
811
+ result = df .prod (** kwargs )
812
+ expected = Series (expected_result ).astype (float_type )
813
+ tm .assert_series_equal (result , expected )
814
+
798
815
def test_sum_object (self , float_frame ):
799
816
values = float_frame .values .astype (int )
800
817
frame = DataFrame (values , index = float_frame .index , columns = float_frame .columns )
0 commit comments