8000 BUG: don't propagate subtypes from np.where · numpy/numpy@8dd2e47 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8dd2e47

Browse files
committed
BUG: don't propagate subtypes from np.where
the C implementation cannot preserve subclass attributes, this needs a python wrapper using indexing for subclasses. closes gh-5095
1 parent 7be6655 commit 8dd2e47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

numpy/core/src/multiarray/multiarraymodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2763,7 +2763,7 @@ PyArray_Where(PyObject *condition, PyObject *x, PyObject *y)
27632763
6008 NULL, arr, ax, ay
27642764
};
27652765
npy_uint32 op_flags[4] = {
2766-
NPY_ITER_WRITEONLY | NPY_ITER_ALLOCATE,
2766+
NPY_ITER_WRITEONLY | NPY_ITER_ALLOCATE | NPY_ITER_NO_SUBTYPE,
27672767
NPY_ITER_READONLY, NPY_ITER_READONLY, NPY_ITER_READONLY
27682768
};
27692769
PyArray_Descr * common_dt = PyArray_ResultType(2, &op_in[0] + 2,

0 commit comments

Comments
 (0)
0