1010# np.sign emits a warning with nans, <https://github.com/numpy/numpy/issues/15127>
1111@pytest .mark .filterwarnings ("ignore:invalid value encountered in sign:RuntimeWarning" )
1212def test_ufuncs_single_int (ufunc ):
13- a = pd .array ([1 , 2 , - 3 , np . nan ] )
13+ a = pd .array ([1 , 2 , - 3 , pd . NA ], dtype = "Int64" )
1414 result = ufunc (a )
1515 expected = pd .array (ufunc (a .astype (float )), dtype = "Int64" )
1616 tm .assert_extension_array_equal (result , expected )
@@ -23,7 +23,7 @@ def test_ufuncs_single_int(ufunc):
2323
2424@pytest .mark .parametrize ("ufunc" , [np .log , np .exp , np .sin , np .cos , np .sqrt ])
2525def test_ufuncs_single_float (ufunc ):
26- a = pd .array ([1 , 2 , - 3 , np . nan ] )
26+ a = pd .array ([1 , 2 , - 3 , pd . NA ], dtype = "Int64" )
2727 with np .errstate (invalid = "ignore" ):
2828 result = ufunc (a )
2929 expected = FloatingArray (ufunc (a .astype (float )), mask = a ._mask )
@@ -39,7 +39,7 @@ def test_ufuncs_single_float(ufunc):
3939@pytest .mark .parametrize ("ufunc" , [np .add , np .subtract ])
4040def test_ufuncs_binary_int (ufunc ):
4141 # two IntegerArrays
42- a = pd .array ([1 , 2 , - 3 , np . nan ] )
42+ a = pd .array ([1 , 2 , - 3 , pd . NA ], dtype = "Int64" )
4343 result = ufunc (a , a )
4444 expected = pd .array (ufunc (a .astype (float ), a .astype (float )), dtype = "Int64" )
4545 tm .assert_extension_array_equal (result , expected )
@@ -99,7 +99,7 @@ def test_ufunc_reduce_raises(values):
9999 ],
100100)
101101def test_stat_method (pandasmethname , kwargs ):
102- s = pd .Series (data = [1 , 2 , 3 , 4 , 5 , 6 , np . nan , np . nan ], dtype = "Int64" )
102+ s = pd .Series (data = [1 , 2 , 3 , 4 , 5 , 6 , pd . NA , pd . NA ], dtype = "Int64" )
103103 pandasmeth = getattr (s , pandasmethname )
104104 result = pandasmeth (** kwargs )
105105 s2 = pd .Series (data = [1 , 2 , 3 , 4 , 5 , 6 ], dtype = "Int64" )
0 commit comments