@@ -857,40 +857,33 @@ def test_modulo_zero_int(self):
857
857
tm .assert_series_equal (result , expected )
858
858
859
859
def test_np_array_mul_ea_array_returns_extensionarray (self ):
860
- np_array = np .array ([1 , 2 , 3 , 4 , 5 ], dtype = tm . SIGNED_INT_NUMPY_DTYPES [ 0 ] )
861
- ea_array = pd .array ([1 , 2 , 3 , 4 , 5 ], dtype = tm . SIGNED_INT_EA_DTYPES [ 0 ] )
860
+ np_array = np .array ([1 , 2 , 3 , 4 , 5 ], dtype = np . int64 )
861
+ ea_array = pd .array ([1 , 2 , 3 , 4 , 5 ], dtype = "Int64" )
862
862
result = np_array * ea_array
863
863
assert isinstance (result , type (ea_array ))
864
864
tm .assert_equal (
865
- result , pd .array ([1 , 4 , 9 , 16 , 25 ], dtype = tm . SIGNED_INT_EA_DTYPES [ 0 ] )
865
+ result , pd .array ([1 , 4 , 9 , 16 , 25 ], dtype = "Int64" )
866
866
)
867
867
868
868
def test_df_mul_np_and_ea_array_shape_and_errors (self ):
869
869
df = pd .DataFrame (np .arange (50 ).reshape (10 , 5 )).notna ().values
870
- NP_array = pd .array (
871
- list (range (10 )), dtype = tm .SIGNED_INT_NUMPY_DTYPES [0 ]
872
- ).reshape (10 , 1 )
873
- EA_array = pd .array (list (range (10 )), dtype = tm .SIGNED_INT_EA_DTYPES [0 ]).reshape (
874
- 10 , 1
875
- )
870
+ NP_array = np .array (
871
+ list (range (10 )), dtype = np .int64 ).reshape (10 , 1 )
872
+ EA_array = pd .array (list (range (10 )), dtype = "Int64" ).reshape (10 , 1 )
876
873
result_np = df * NP_array
877
874
assert isinstance (result_np , np .ndarray )
878
875
tm .assert_equal (result_np .shape , (10 , 5 ))
879
876
880
- with pytest .raises (TypeError ):
877
+ with pytest .raises (NotImplementedError ):
881
878
_ = df * EA_array
882
879
883
880
def test_non_1d_ea_raises_typeerror (self ):
884
- ea_array = pd .array ([1 , 2 , 3 , 4 , 5 ], dtype = tm .SIGNED_INT_EA_DTYPES [0 ]).reshape (
885
- 5 , 1
886
- )
887
- np_array = np .array (
888
- [1 , 2 , 3 , 4 , 5 ], dtype = tm .SIGNED_INT_NUMPY_DTYPES [0 ]
889
- ).reshape (5 , 1 )
881
+ ea_array = pd .array ([1 , 2 , 3 , 4 , 5 ], dtype = "Int64" ).reshape (5 , 1 )
882
+ np_array = np .array ([1 , 2 , 3 , 4 , 5 ], dtype = np .int64 ).reshape (5 , 1 )
890
883
891
- with pytest .raises (TypeError ):
884
+ with pytest .raises (NotImplementedError ):
892
885
_ = ea_array * np_array
893
- with pytest .raises (TypeError ):
886
+ with pytest .raises (NotImplementedError ):
894
887
_ = np_array * ea_array
895
888
896
889
0 commit comments