Skip to content

Advanced indexing #78

Closed
Closed

Description

@alimanfoo

It would be fairly straightforward to add support for indexing a Zarr array with a boolean array or list/array of indices, provided that (1) only one dimension has a fancy index, and (2) if a list/array of indices, indices are given in increasing order.

Activity

  1. alimanfoo commented on Sep 23, 2016

    @alimanfoo
    MemberAuthor

    See also #77

  2. jakirkham commented on Dec 1, 2016

    @jakirkham
    Member

    So I'm trying to think of the best way to reformat indices of this sort into an easier to work with form per our earlier discussion.

    I have other code library that would be pretty easy to move into kenjutsu. This code converts a list of indices into a bool array. Though it would be pretty easy to also handle arrays of indices too. This works with arbitrary numbers of dimensions, but certainly could be used in only 1D cases.

    Also I have some code that could be refactored out that takes an unordered list of indices and orders it, but also provides an additional set of indices to map the ordered indices back into the intended ordering. It works pretty nicely with NumPy arrays and could be handy here. Doesn't handle arrays of indices, but could look into that.

    Does any of this sound interesting? Do you have some other ideas about how you would like to work with these cases?

  3. alimanfoo commented on Dec 1, 2016

    @alimanfoo
    MemberAuthor
  4. jakirkham commented on Dec 9, 2016

    @jakirkham
    Member

    Thanks for all the info. I've been giving this some thought and playing with some things on my end. Let me see if I can get something more concrete for us to discuss.

  5. alimanfoo commented on Dec 9, 2016

    @alimanfoo
    MemberAuthor
  6. modified the milestone: v2.2 on Jan 24, 2017
  7. jakirkham commented on Feb 13, 2017

    @jakirkham
    Member

    What about something where we break slices that have multiple indices into a set of slices with a single index each and iterate over them? Worked up something like this in PR ( jakirkham/kenjutsu#52 ), which I'm starting to play with and it seems to do alright.

  8. jakirkham commented on Feb 18, 2017

    @jakirkham
    Member

    The 0.4.0 version of kenjutsu (now on PyPI and conda-forge) should provide you a way to solve the list of indices in one dimension problem.

  9. alimanfoo commented on Feb 18, 2017

    @alimanfoo
    MemberAuthor
  10. jakirkham commented on Feb 20, 2017

    @jakirkham
    Member

    So PR ( https://github.com/alimanfoo/zarr/pull/116 ) implements this functionality using kenjutsu. If you have time, would appreciate your feedback there.

  11. changed the title [-]Fancy indexing (single dimension)[/-] [+]Advanced indexing[/+] on Oct 31, 2017
  12. added
    enhancementNew features or improvements
    release notes doneAutomatically applied to PRs which have release notes.
    on Nov 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew features or improvementsrelease notes doneAutomatically applied to PRs which have release notes.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions