Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nd.take with ?bool #388

Open
mrocklin opened this issue Oct 17, 2015 · 1 comment
Open

nd.take with ?bool #388

mrocklin opened this issue Oct 17, 2015 · 1 comment

Comments

@mrocklin
Copy link

I actually don't know what proper behavior is here. Maybe return an option type with the missing values? It might be worth looking into how systems like R do this.

In [1]: from dynd import nd

In [2]: x = nd.array([1, 10, None], dtype='?int')

In [3]: nd.take(x, x > 5)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-3-97c4aec2b521> in <module>()
----> 1 nd.take(x, x > 5)

dynd/nd/callable.pyx in dynd.nd.callable.callable.__call__ (/home/travis/build/libdynd/dynd-python/build/temp.linux-x86_64-3.4/callable.cxx:786)()

ValueError: take: unsupported type for the index ?bool, need bool or intptr
@mwiebe
Copy link
Member

mwiebe commented Oct 17, 2015

I guess do what R does. See http://docs.scipy.org/doc/numpy/neps/missing-data.html#boolean-indexing for some previous thoughts on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants