@@ -697,13 +697,13 @@ def partition(a, kth, axis=-1, kind='introselect', order=None):
697
697
"""
698
698
Return a partitioned copy of an array.
699
699
700
- Creates a copy of the array with its elements rearranged in such a
701
- way that the value of the element in k-th position is in the position
702
- the value would be in a sorted array. In the partitioned array, all
703
- elements before the k-th element are less than or equal to that
704
- element, and all the elements after the k-th element are greater than
705
- or equal to that element. The ordering of the elements in the two
706
- partitions is undefined.
700
+ Creates a copy of the array and partially sorts it in such a way that
701
+ the value of the element in k-th position is in the position it would be
702
+ in a sorted array. In the output array, all elements smaller than the k-th
703
+ element are located to the left of this element and all equal or greater
704
+ are located to its right. The ordering of the elements in the two
705
+ partitions on the either side of the k-th element in the output array is
706
+ undefined.
707
707
708
708
.. versionadded:: 1.8.0
709
709
@@ -884,7 +884,7 @@ def argpartition(a, kth, axis=-1, kind='introselect', order=None):
884
884
>>> x = np.array([[3, 4, 2], [1, 3, 1]])
885
885
>>> index_array = np.argpartition(x, kth=1, axis=-1)
886
886
>>> # below is the same as np.partition(x, kth=1)
887
- >>> np.take_along_axis(x, index_array, axis=-1)
887
+ >>> np.take_along_axis(x, index_array, axis=-1)
888
888
array([[2, 3, 4],
889
889
[1, 1, 3]])
890
890
@@ -1364,7 +1364,7 @@ def argmin(a, axis=None, out=None, *, keepdims=np._NoValue):
1364
1364
array([[2],
1365
1365
[0]])
1366
1366
>>> # Same as np.amax(x, axis=-1)
1367
- >>> np.take_along_axis(x, np.expand_dims(index_array, axis=-1),
1367
+ >>> np.take_along_axis(x, np.expand_dims(index_array, axis=-1),
1368
1368
... axis=-1).squeeze(axis=-1)
1369
1369
array([2, 0])
1370
1370
@@ -1437,7 +1437,7 @@ def searchsorted(a, v, side='left', sorter=None):
1437
1437
As of NumPy 1.4.0 `searchsorted` works with real/complex arrays containing
1438
1438
`nan` values. The enhanced sort order is documented in `sort`.
1439
1439
1440
- This function uses the same algorithm as the builtin python
1440
+ This function uses the same algorithm as the builtin python
1441
1441
`bisect.bisect_left` (``side='left'``) and `bisect.bisect_right`
1442
1442
(``side='right'``) functions, which is also vectorized
1443
1443
in the `v` argument.
@@ -2371,7 +2371,7 @@ def sum(a, axis=None, dtype=None, out=None, keepdims=np._NoValue,
2371
2371
return res
2372
2372
2373
2373
return _wrapreduction (
2374
- a , np .add , 'sum' , axis , dtype , out ,
2374
+ a , np .add , 'sum' , axis , dtype , out ,
2375
2375
keepdims = keepdims , initial = initial , where = where
2376
2376
)
2377
2377
0 commit comments