@@ -789,12 +789,29 @@ def test_sum_nanops_min_count(self):
789789 )
790790 def test_sum_nanops_dtype_min_count (self , float_type , kwargs , expected_result ):
791791 # GH#46947
792- # pass
793792 df = DataFrame ({"a" : [1.0 , 2.3 , 4.4 ], "b" : [2.2 , 3 , np .nan ]}, dtype = float_type )
794793 result = df .sum (** kwargs )
795794 expected = Series (expected_result ).astype (float_type )
796795 tm .assert_series_equal (result , expected )
797796
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+
798815 def test_sum_object (self , float_frame ):
799816 values = float_frame .values .astype (int )
800817 frame = DataFrame (values , index = float_frame .index , columns = float_frame .columns )
0 commit comments