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

Function array_diagonal

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

Source from the content-addressed store, hash-verified

2619
2620
2621static PyObject *
2622array_diagonal(PyArrayObject *self, PyObject *args, PyObject *kwds)
2623{
2624 int axis1 = 0, axis2 = 1, offset = 0;
2625 static char *kwlist[] = {"offset", "axis1", "axis2", NULL};
2626 PyArrayObject *ret;
2627
2628 if (!PyArg_ParseTupleAndKeywords(args, kwds, "|iii:diagonal", kwlist,
2629 &offset,
2630 &axis1,
2631 &axis2)) {
2632 return NULL;
2633 }
2634
2635 ret = (PyArrayObject *)PyArray_Diagonal(self, offset, axis1, axis2);
2636 return PyArray_Return(ret);
2637}
2638
2639
2640static PyObject *

Callers

nothing calls this directly

Calls 2

PyArray_DiagonalFunction · 0.85
PyArray_ReturnFunction · 0.85

Tested by

no test coverage detected