8000 ENH: Adding keepdims to np.argmin,np.argmax by czgdp1807 · Pull Request #19211 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: Adding keepdims to np.argmin,np.argmax #19211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 38 commits into from
Jul 7, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
0e5817e
keepdims added to np.argmin,np.argmax
czgdp1807 Jun 10, 2021
5d66427
Added release notes entry
czgdp1807 Jun 10, 2021
4d8f3af
tested for axis=None,keepdims=True
czgdp1807 Jun 10, 2021
aa2adc9
Apply suggestions from code review
czgdp1807 Jun 10, 2021
f7d4df4
updated interface
czgdp1807 Jun 10, 2021
1e725c7
updated interface
czgdp1807 Jun 10, 2021
4d2bfab
API changed, implementation to be done
czgdp1807 Jun 10, 2021
09433d6
Added reshape approach to C implementation
czgdp1807 Jun 11, 2021
8ea07b4
buggy implementation without reshape
czgdp1807 Jun 11, 2021
aa73907
TestArgMax, TestArgMin fixed, comments added
czgdp1807 Jun 12, 2021
22fbb06
Fixed for matrix
czgdp1807 Jun 12, 2021
d04946f
removed u 8000 nrequired changes
czgdp1807 Jun 12, 2021
512b359
fixed CI failure
czgdp1807 Jun 12, 2021
da3df5b
fixed linting issue
czgdp1807 Jun 12, 2021
828df3b
PyArray_ArgMaxKeepdims now only modifies shape and strides
czgdp1807 Jun 18, 2021
91e7530
Comments added to PyArray_ArgMaxKeepdims
czgdp1807 Jun 18, 2021
a1c0faa
Updated implementation of PyArray_ArgMinKeepdims to match with PyArra…
czgdp1807 Jun 18, 2021
fa5839b
Testing complete for PyArray_ArgMinKeepdims and PyArray_ArgMaxKeepdims
czgdp1807 Jun 18, 2021
2cd3ff1
PyArray_ArgMinWithKeepdims both keepdims=True and keepdims=False
czgdp1807 Jun 19, 2021
124abe3
matched implementation of PyArray_ArgMaxKeepdims and PyArray_ArgMinKe…
czgdp1807 Jun 19, 2021
6bd9f4c
simplified implementation
czgdp1807 Jun 19, 2021
55a85d3
Added missing comment
czgdp1807 Jun 19, 2021
568251e
removed unwanted header
czgdp1807 Jun 19, 2021
9260d40
addressed all the reviews
czgdp1807 Jun 21, 2021
06d9610
Removing unwanted changes
czgdp1807 Jun 21, 2021
2112709
fixed docs
czgdp1807 Jun 21, 2021
e0dd74e
Added new lines
czgdp1807 Jun 21, 2021
11d7e33
restored annotations
czgdp1807 Jun 22, 2021
eec3e2f
Merge branch 'keepdims' of https://github.com/czgdp1807/numpy into ke…
czgdp1807 Jun 22, 2021
4c9f113
parametrized test
czgdp1807 Jun 24, 2021
db9c704
Apply suggestions from code review
czgdp1807 Jun 30, 2021
11cd597
keyword handling now done in np.argmin/np.argmax
czgdp1807 Jun 30, 2021
bb906bf
corrected indendation
czgdp1807 Jun 30, 2021
3b72f59
used with pytest.riases(ValueError)
czgdp1807 Jun 30, 2021
66adc84
fixed release notes
czgdp1807 Jun 30, 2021
4be86dd
removed PyArray_ArgMaxWithKeepdims and PyArray_ArgMinWithKeepdims fro…
czgdp1807 Jul 2, 2021
8f9f108
Apply suggestions from code review
czgdp1807 Jul 2, 2021
c55aaea
Apply suggestions from code review
czgdp1807 Jul 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed release notes
  • Loading branch information
czgdp1807 committed Jun 30, 2021
commit 66adc84e0add1ca3af5b0b940246ca0c69fecaab
10 changes: 10 additions & 0 deletions doc/release/upcoming_changes/19211.c_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Addition of ``PyArray_ArgMinWithKeepdims`` and ``PyArray_ArgMaxWithKeepdims``
-----------------------------------------------------------------------------

Two new functions ``PyArray_ArgMinWithKeepdims`` and ``PyArray_ArgMaxWithKeepdims``
are added. The signatures of these functions are same as ``PyArray_ArgMin`` and
``PyArray_ArgMax`` but with one additional argument, ``int keepdims``. If ``keepdims``
is equivalent to ``true`` then the axes which are reduced are left in the result as
dimensions with size one. The resulting array has the same number of dimensions and
will broadcast with the input array. Otherwise, the result will be same as the existing,
``PyArray_ArgMin`` and ``PyArray_ArgMax``, both of which have no change in their behaviour.
1 change: 0 additions & 1 deletion doc/release/upcoming_changes/19211.new_feature.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@

``keepdims`` argument is added to `numpy.argmin`, `numpy.argmax`.
If set to ``True``, the axes which are reduced are left in the result as dimensions with size one.
the axes which are reduced are left in the result as dimensions with size one.
The resulting array has the same number of dimensions and will broadcast with the
input array.
0