summaryrefslogtreecommitdiff
path: root/numpy/core/src/arraymethods.c
diff options
context:
space:
mode:
authorcookedm <cookedm@localhost>2006-08-23 23:39:42 +0000
committercookedm <cookedm@localhost>2006-08-23 23:39:42 +0000
commit9ab77ec1e9fdd2ebe5dfe2eccd7ad129189ea076 (patch)
tree3c8b6824c10fcf35bb046abc73f87d2d90b840c6 /numpy/core/src/arraymethods.c
parenteb334fc4722b27cdad024784dc3246c80febfb35 (diff)
downloadnumpy-9ab77ec1e9fdd2ebe5dfe2eccd7ad129189ea076.tar.gz
add .abs() as a method on the array object
Diffstat (limited to 'numpy/core/src/arraymethods.c')
-rw-r--r--numpy/core/src/arraymethods.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/core/src/arraymethods.c b/numpy/core/src/arraymethods.c
index 9cbe5b455..8f7bce20d 100644
--- a/numpy/core/src/arraymethods.c
+++ b/numpy/core/src/arraymethods.c
@@ -252,6 +252,8 @@ array_min(PyArrayObject *self, PyObject *args, PyObject *kwds)
return PyArray_Min(self, axis, out);
}
+static char doc_abs[] = "a.abs() returns abs(a)";
+
static char doc_swapaxes[] = "a.swapaxes(axis1, axis2) returns new view with axes swapped.";
static PyObject *
@@ -1806,6 +1808,8 @@ static PyMethodDef array_methods[] = {
METH_VARARGS|METH_KEYWORDS, doc_min},
{"ptp", (PyCFunction)array_ptp,
METH_VARARGS|METH_KEYWORDS, doc_ptp},
+ {"abs", (PyCFunction)array_absolute,
+ METH_VARARGS, doc_abs},
{"mean", (PyCFunction)array_mean,
METH_VARARGS|METH_KEYWORDS, doc_mean},
{"trace", (PyCFunction)array_trace,