From 96d5993c4fca186f8c9f0f686c963549a03d0636 Mon Sep 17 00:00:00 2001 From: Bas van Beek <43369155+BvB93@users.noreply.github.com> Date: Sun, 3 Oct 2021 02:21:11 +0200 Subject: BUG,DEP: Allow (arg-)partition to accept `uint64` indices (#20000) * BUG: Allow (arg-)partition to accept `uint64` indices * DEP: Deprecate the use of booleans as (arg-)partition indices * TST,DEP: Add tests for the `parametrize` bool-index-deprecation * TST: Add more dtype-based tests for (arg-)partition * DOC: Add a release note for the (arg-)partition boolean deprecation * DEP: Explicitly mention numpy 1.22 in the (arg-)partition deprecation warning Co-Authored-By: Sebastian Berg Co-authored-by: Sebastian Berg --- numpy/core/fromnumeric.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'numpy/core/fromnumeric.py') diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index 5ecb1e666..29d215ea0 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -689,6 +689,9 @@ def partition(a, kth, axis=-1, kind='introselect', order=None): it. The order of all elements in the partitions is undefined. If provided with a sequence of k-th it will partition all elements indexed by k-th of them into their sorted position at once. + + .. deprecated:: 1.22.0 + Passing booleans as index is deprecated. axis : int or None, optional Axis along which to sort. If None, the array is flattened before sorting. The default is -1, which sorts along the last axis. @@ -781,6 +784,9 @@ def argpartition(a, kth, axis=-1, kind='introselect', order=None): elements in the partitions is undefined. If provided with a sequence of k-th it will partition all of them into their sorted position at once. + + .. deprecated:: 1.22.0 + Passing booleans as index is deprecated. axis : int or None, optional Axis along which to sort. The default is -1 (the last axis). If None, the flattened array is used. -- cgit v1.2.1