@@ -1027,7 +1027,7 @@ def select(condlist, choicelist, default=0):
1027
1027
dtype = np .result_type (* choicelist )
1028
1028
1029
1029
# Convert conditions to arrays and broadcast conditions and choices
1030
- # as the shape is needed for the result. Doing it seperatly optimizes
1030
+ # as the shape is needed for the result. Doing it separately optimizes
1031
1031
# for example when all choices are scalars.
1032
1032
condlist = np .broadcast_arrays (* condlist )
1033
1033
choicelist = np .broadcast_arrays (* choicelist )
@@ -1249,7 +1249,7 @@ def gradient(f, *varargs, **kwargs):
1249
1249
1250
1250
# Convert datetime64 data into ints. Make dummy variable `y`
1251
1251
# that is a view of ints if the data is datetime64, otherwise
1252
- # just set y equal to the the array `f`.
1252
+ # just set y equal to the array `f`.
1253
1253
if f .dtype .char in ["M" , "m" ]:
1254
1254
y = f .view ('int64' )
1255
1255
else :
@@ -3543,7 +3543,7 @@ def _percentile(a, q, axis=None, out=None,
3543
3543
elif interpolation == 'higher' :
3544
3544
indices = ceil (indices ).astype (intp )
3545
3545
elif interpolation == 'midpoint' :
3546
- indices = floor (indices ) + 0.5
3546
+ indices = 0.5 * ( floor (indices ) + ceil ( indices ))
3547
3547
elif interpolation == 'nearest' :
3548
3548
indices = around (indices ).astype (intp )
3549
3549
elif interpolation == 'linear' :
0 commit comments