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

RaggedArray fails with len(shape) >= 3 and slices #54

Closed
justinrporter opened this issue Jul 13, 2017 · 1 comment
Closed

RaggedArray fails with len(shape) >= 3 and slices #54

justinrporter opened this issue Jul 13, 2017 · 1 comment
Assignees
Labels

Comments

@justinrporter
Copy link
Collaborator

justinrporter commented Jul 13, 2017

a = ra.RaggedArray([[[0, 1, 0, 1],
                     [0, 1, 0, 1]],
                    [[1, 1, 1, 1, 0],
                     [0, 0, 0, 0, 1]]])

a[:, :, 0]

Fails with

ValueError                                Traceback (most recent call last)
<ipython-input-5-caa57490a0a5> in <module>()
----> 1 a[:, :, 0]

/Users/jrporter/projects/enspara/enspara/util/array.py in __getitem__(self, iis)
    458         # tuples get index conversion from 2d to 1d
    459         elif type(iis) is tuple:
--> 460             first_dimension, second_dimension = iis
    461             # if the first dimension is a slice, converts both sets of indices
    462             if type(first_dimension) is slice:

ValueError: too many values to unpack (expected 2)

So does a[:, 0, :] and a[0, :, :].

Also, the dtype of a is object, which isn't what I expected (since they're ints) and the shape is [2, 2, None] where I expected [2, None, 2]...

@mizimmer90
Copy link
Collaborator

see #164

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

No branches or pull requests

2 participants