summaryrefslogtreecommitdiff
path: root/numpy/core/src/arrayobject.c
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-08-26 00:49:30 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-08-26 00:49:30 +0000
commitc37cfa5b256d257a339b30334392c93ae8b7d78a (patch)
tree0f38e309e8bd128b299029bfda9621c9721253ed /numpy/core/src/arrayobject.c
parent28e44d3bbe831956a10064de2b76298316dc7cf5 (diff)
downloadnumpy-c37cfa5b256d257a339b30334392c93ae8b7d78a.tar.gz
Add deletefrom, insertinto, and appendonto
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r--numpy/core/src/arrayobject.c13
1 files changed, 10 insertions, 3 deletions
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 {