From c37cfa5b256d257a339b30334392c93ae8b7d78a Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Sat, 26 Aug 2006 00:49:30 +0000 Subject: Add deletefrom, insertinto, and appendonto --- numpy/core/src/arrayobject.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'numpy/core/src/arrayobject.c') diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index 13a5ef12f..360f801e3 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -4693,9 +4693,16 @@ _check_axis(PyArrayObject *arr, int *axis, int flags) int n = arr->nd; if ((*axis >= MAX_DIMS) || (n==0)) { - temp = PyArray_Ravel(arr,0); - if (temp) *axis = PyArray_NDIM(temp)-1; - else *axis = 0; + if (n != 1) { + temp = PyArray_Ravel(arr,0); + if (temp) *axis = PyArray_NDIM(temp)-1; + else *axis = 0; + } + else { + temp = (PyObject *)arr; + Py_INCREF(temp); + *axis = 0; + } return temp; } else { -- cgit v1.2.1