Skip to content

Commit cfd2005

Browse files
committed
BUG: correct lib.ismember 32-bit data access issue
1 parent dc0db65 commit cfd2005

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pandas/src/tseries.pyx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,20 +107,17 @@ def ismember(ndarray arr, set values):
107107
'''
108108
cdef:
109109
Py_ssize_t i, n
110-
flatiter it
111110
ndarray[uint8_t] result
112111
object val
113112

114-
it = <flatiter> PyArray_IterNew(arr)
115113
n = len(arr)
116114
result = np.empty(n, dtype=np.uint8)
117115
for i in range(n):
118-
val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))
116+
val = util.get_value_at(arr, i)
119117
if val in values:
120118
result[i] = 1
121119
else:
122120
result[i] = 0
123-
PyArray_ITER_NEXT(it)
124121

125122
return result.view(np.bool_)
126123

0 commit comments

Comments
 (0)