Skip to content

Commit

Permalink
BUG: correct lib.ismember 32-bit data access issue
Browse files Browse the repository at this point in the history
  • Loading branch information
wesm committed Sep 9, 2012
1 parent dc0db65 commit cfd2005
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pandas/src/tseries.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,17 @@ def ismember(ndarray arr, set values):
'''
cdef:
Py_ssize_t i, n
flatiter it
ndarray[uint8_t] result
object val

it = <flatiter> PyArray_IterNew(arr)
n = len(arr)
result = np.empty(n, dtype=np.uint8)
for i in range(n):
val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))
val = util.get_value_at(arr, i)
if val in values:
result[i] = 1
else:
result[i] = 0
PyArray_ITER_NEXT(it)

return result.view(np.bool_)

Expand Down

0 comments on commit cfd2005

Please sign in to comment.