MCPcopy Create free account
hub / github.com/numpy/numpy / array_argmin

Function array_argmin

numpy/core/src/multiarray/methods.c:314–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312}
313
314static PyObject *
315array_argmin(PyArrayObject *self,
316 PyObject *const *args, Py_ssize_t len_args, PyObject *kwnames)
317{
318 int axis = NPY_MAXDIMS;
319 PyArrayObject *out = NULL;
320 npy_bool keepdims = NPY_FALSE;
321 NPY_PREPARE_ARGPARSER;
322 if (npy_parse_arguments("argmin", args, len_args, kwnames,
323 "|axis", &PyArray_AxisConverter, &axis,
324 "|out", &PyArray_OutputConverter, &out,
325 "$keepdims", &PyArray_BoolConverter, &keepdims,
326 NULL, NULL, NULL) < 0) {
327 return NULL;
328 }
329
330 PyObject *ret = _PyArray_ArgMinWithKeepdims(self, axis, out, keepdims);
331
332 /* this matches the unpacking behavior of ufuncs */
333 if (out == NULL) {
334 return PyArray_Return((PyArrayObject *)ret);
335 }
336 else {
337 return ret;
338 }
339}
340
341static PyObject *
342array_max(PyArrayObject *self, PyObject *args, PyObject *kwds)

Callers

nothing calls this directly

Calls 2

PyArray_ReturnFunction · 0.85

Tested by

no test coverage detected