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

as_strided fails on dtypes with overlapping fields #12432

Open
eric-wieser opened this issue Nov 21, 2018 · 0 comments
Open

as_strided fails on dtypes with overlapping fields #12432

eric-wieser opened this issue Nov 21, 2018 · 0 comments

Comments

@eric-wieser
Copy link
Member

eric-wieser commented Nov 21, 2018

Caused by dtype.descr being broken by design, and __array_interface__ being broken by association.

cc @ahaldane

>>> dt = np.dtype(dict(
            formats=['<i4', '<i4'],
            names=['a', 'b'],
            offsets=[0, 2],
            itemsize=6
        ))
>>> a = np.zeros(10, dt)
>>> np.lib.index_tricks.as_strided(a)
TypeError: data type not understood

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<pyshell#132>", line 1, in <module>
    np.lib.index_tricks.as_strided(a)
  File "C:\Users\wiese\AppData\Roaming\Python\Python35\site-packages\numpy\lib\stride_tricks.py", line 102, in as_strided
    array = np.asarray(DummyArray(interface, base=x))
  File "C:\Users\wiese\AppData\Roaming\Python\Python35\site-packages\numpy\core\numeric.py", line 501, in asarray
    return array(a, dtype, copy=False, order=order)
SystemError: <built-in function array> returned a result with an error set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants