File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -2991,7 +2991,7 @@ static int
2991
2991
memcpy (mp , ip , elsize );
2992
2992
* max_ind = 0 ;
2993
2993
for (i = 1 ; i < n ; i ++ ) {
2994
- ip += elsize ;
2994
+ ip += elsize / sizeof (@ type @) ;
2995
2995
if (@fname @_compare (ip , mp , aip ) > 0 ) {
2996
2996
memcpy (mp , ip , elsize );
2997
2997
* max_ind = i ;
@@ -3048,7 +3048,7 @@ static int
3048
3048
memcpy (mp , ip , elsize );
3049
3049
* min_ind = 0 ;
3050
3050
for (i = 1 ; i < n ; i ++ ) {
3051
- ip += elsize ;
3051
+ ip += elsize / sizeof (@ type @) ;
3052
3052
if (@fname @_compare (mp ,ip ,aip ) > 0 ) {
3053
3053
memcpy (mp , ip , elsize );
3054
3054
* min_ind = i ;
Original file line number Diff line number Diff line change @@ -2144,6 +2144,11 @@ def test_output_shape(self):
2144
2144
a .argmax (- 1 , out = out )
2145
2145
assert_equal (out , a .argmax (- 1 ))
2146
2146
2147
+ def test_argmax_unicode (self ):
2148
+ d = np .zeros (6031 , dtype = '<U9' )
2149
+ d [5942 ] = "as"
2150
+ assert_equal (d .argmax (), 5942 )
2151
+
2147
2152
2148
2153
class TestArgmin (TestCase ):
2149
2154
@@ -2249,6 +2254,11 @@ def test_output_shape(self):
2249
2254
a .argmin (- 1 , out = out )
2250
2255
assert_equal (out , a .argmin (- 1 ))
2251
2256
2257
+ def test_argmin_unicode (self ):
2258
+ d = np .ones (6031 , dtype = '<U9' )
2259
+ d [6001 ] = "0"
2260
+ assert_equal (d .argmin (), 6001 )
2261
+
2252
2262
2253
2263
class TestMinMax (TestCase ):
2254
2264
def test_scalar (self ):
You can’t perform that action at this time.
0 commit comments