We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 28c491d + 13224ff commit 4bcde89Copy full SHA for 4bcde89
bottleneck/src/nonreduce_axis_template.c
@@ -202,8 +202,13 @@ NRA(rankdata, DTYPE0) {
202
npy_DTYPE1 old, new, averank, sumranks = 0;
203
204
PyObject *z = PyArray_ArgSort(a, axis, NPY_QUICKSORT);
205
+ if (z == NULL) return NULL;
206
PyObject *y = PyArray_EMPTY(PyArray_NDIM(a),
207
PyArray_SHAPE(a), NPY_DTYPE1, 0);
208
+ if (y == NULL) {
209
+ Py_DECREF(z);
210
+ return NULL;
211
+ }
212
213
iter3 it;
214
init_iter3(&it, a, y, z, axis);
@@ -264,8 +269,13 @@ NRA(nanrankdata, DTYPE0) {
264
269
265
270
266
271
272
267
273
268
274
275
276
277
278
279
280
281
0 commit comments