| 284 | } |
| 285 | |
| 286 | static PyObject * |
| 287 | array_argmax(PyArrayObject *self, |
| 288 | PyObject *const *args, Py_ssize_t len_args, PyObject *kwnames) |
| 289 | { |
| 290 | int axis = NPY_MAXDIMS; |
| 291 | PyArrayObject *out = NULL; |
| 292 | npy_bool keepdims = NPY_FALSE; |
| 293 | NPY_PREPARE_ARGPARSER; |
| 294 | |
| 295 | if (npy_parse_arguments("argmax", args, len_args, kwnames, |
| 296 | "|axis", &PyArray_AxisConverter, &axis, |
| 297 | "|out", &PyArray_OutputConverter, &out, |
| 298 | "$keepdims", &PyArray_BoolConverter, &keepdims, |
| 299 | NULL, NULL, NULL) < 0) { |
| 300 | return NULL; |
| 301 | } |
| 302 | |
| 303 | PyObject *ret = _PyArray_ArgMaxWithKeepdims(self, axis, out, keepdims); |
| 304 | |
| 305 | /* this matches the unpacking behavior of ufuncs */ |
| 306 | if (out == NULL) { |
| 307 | return PyArray_Return((PyArrayObject *)ret); |
| 308 | } |
| 309 | else { |
| 310 | return ret; |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | static PyObject * |
| 315 | array_argmin(PyArrayObject *self, |
nothing calls this directly
no test coverage detected