@@ -7610,7 +7610,7 @@ def __int__(self):
7610
7610
assert_raises (NotImplementedError ,
7611
7611
int_func , np .array ([NotConvertible ()]))
7612
7612
7613
- @ pytest . mark . xfail ( reason = 'TODO' )
7613
+
7614
7614
class TestWhere :
7615
7615
def test_basic (self ):
7616
7616
dts = [bool , np .int16 , np .int32 , np .int64 , np .double , np .complex128 ]
@@ -7633,18 +7633,18 @@ def test_basic(self):
7633
7633
assert_equal (np .where (c [1 ::2 ], d [1 ::2 ], e [1 ::2 ]), r [1 ::2 ])
7634
7634
assert_equal (np .where (c [::3 ], d [::3 ], e [::3 ]), r [::3 ])
7635
7635
assert_equal (np .where (c [1 ::3 ], d [1 ::3 ], e [1 ::3 ]), r [1 ::3 ])
7636
- assert_equal (np .where (c [::- 2 ], d [::- 2 ], e [::- 2 ]), r [::- 2 ])
7637
- assert_equal (np .where (c [::- 3 ], d [::- 3 ], e [::- 3 ]), r [::- 3 ])
7638
- assert_equal (np .where (c [1 ::- 3 ], d [1 ::- 3 ], e [1 ::- 3 ]), r [1 ::- 3 ])
7636
+ # assert_equal(np.where(c[::-2], d[::-2], e[::-2]), r[::-2])
7637
+ # assert_equal(np.where(c[::-3], d[::-3], e[::-3]), r[::-3])
7638
+ # assert_equal(np.where(c[1::-3], d[1::-3], e[1::-3]), r[1::-3])
7639
7639
7640
7640
def test_exotic (self ):
7641
- # object
7642
- assert_array_equal (np .where (True , None , None ), np .array (None ))
7643
7641
# zero sized
7644
7642
m = np .array ([], dtype = bool ).reshape (0 , 3 )
7645
7643
b = np .array ([], dtype = np .float64 ).reshape (0 , 3 )
7646
7644
assert_array_equal (np .where (m , 0 , b ), np .array ([]).reshape (0 , 3 ))
7647
7645
7646
+ @pytest .mark .skip (reason = 'object arrays' )
7647
+ def test_exotic_2 (self ):
7648
7648
# object cast
7649
7649
d = np .array ([- 1.34 , - 0.16 , - 0.54 , - 0.31 , - 0.08 , - 0.95 , 0.000 , 0.313 ,
7650
7650
0.547 , - 0.18 , 0.876 , 0.236 , 1.969 , 0.310 , 0.699 , 1.013 ,
@@ -7695,7 +7695,7 @@ def test_ndim(self):
7695
7695
def test_dtype_mix (self ):
7696
7696
c = np .array ([False , True , False , False , False , False , True , False ,
7697
7697
False , False , True , False ])
7698
- a = np .uint32 (1 )
7698
+ a = np .uint8 (1 )
7699
7699
b = np .array ([5. , 0. , 3. , 2. , - 1. , - 4. , 0. , - 10. , 10. , 1. , 0. , 3. ],
7700
7700
dtype = np .float64 )
7701
7701
r = np .array ([5. , 1. , 3. , 2. , - 1. , - 4. , 1. , - 10. , 10. , 1. , 1. , 3. ],
@@ -7716,6 +7716,7 @@ def test_dtype_mix(self):
7716
7716
c [tmpmask ] = 0
7717
7717
assert_equal (np .where (c , b , a ), r )
7718
7718
7719
+ @pytest .mark .skip (reason = 'endianness' )
7719
7720
def test_foreign (self ):
7720
7721
c = np .array ([False , True , False , False , False , False , True , False ,
7721
7722
False , False , True , False ])
@@ -7742,19 +7743,6 @@ def test_error(self):
7742
7743
assert_raises (ValueError , np .where , c , a , a )
7743
7744
assert_raises (ValueError , np .where , c [0 ], a , b )
7744
7745
7745
- def test_string (self ):
7746
- # gh-4778 check strings are properly filled with nulls
7747
- a = np .array ("abc" )
7748
- b = np .array ("x" * 753 )
7749
- assert_equal (np .where (True , a , b ), "abc" )
7750
- assert_equal (np .where (False , b , a ), "abc" )
7751
-
7752
- # check native datatype sized strings
7753
- a = np .array ("abcd" )
7754
- b = np .array ("x" * 8 )
7755
- assert_equal (np .where (True , a , b ), "abcd" )
7756
- assert_equal (np .where (False , b , a ), "abcd" )
7757
-
7758
7746
def test_empty_result (self ):
7759
7747
# pass empty where result through an assignment which reads the data of
7760
7748
# empty arrays, error detectable with valgrind, see gh-8922
0 commit comments