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

Function normalize_axis_index

numpy/core/src/multiarray/multiarraymodule.c:4454–4475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4452}
4453
4454static PyObject *
4455normalize_axis_index(PyObject *NPY_UNUSED(self),
4456 PyObject *const *args, Py_ssize_t len_args, PyObject *kwnames)
4457{
4458 int axis;
4459 int ndim;
4460 PyObject *msg_prefix = Py_None;
4461 NPY_PREPARE_ARGPARSER;
4462
4463 if (npy_parse_arguments("normalize_axis_index", args, len_args, kwnames,
4464 "axis", &PyArray_PythonPyIntFromInt, &axis,
4465 "ndim", &PyArray_PythonPyIntFromInt, &ndim,
4466 "|msg_prefix", NULL, &msg_prefix,
4467 NULL, NULL, NULL) < 0) {
4468 return NULL;
4469 }
4470 if (check_and_adjust_axis_msg(&axis, ndim, msg_prefix) < 0) {
4471 return NULL;
4472 }
4473
4474 return PyLong_FromLong(axis);
4475}
4476
4477
4478static PyObject *

Callers 15

stackFunction · 0.90
diffFunction · 0.90
deleteFunction · 0.90
insertFunction · 0.90
take_along_axisFunction · 0.90
put_along_axisFunction · 0.90
apply_along_axisFunction · 0.90
normFunction · 0.90
apply_along_axisFunction · 0.90
_medianFunction · 0.90
hermederFunction · 0.90
hermeintFunction · 0.90

Calls 1

Tested by

no test coverage detected