numpy / numpy/numpy

Add examples of more complex NpyIter usage to the documentation.

Open
#5,695 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

17 - Task component: documentation
Dominant language
Python
Stars
32.8k
Forks
12.8k
Avg merge
1d 7h
Merged PRs (30d)
197

Description

The iterator is nice in some regards, simple things are simple, and simply iterating over all elements is straightforward. However, how to do things like what PyArray_IterAllButAxis does but with multiple broadcasted arrays, etc is pretty opaque. (To me at least; maybe I'm just dense.)

My currently go at using nested iterators to try things out is here, FWIW. I'm performing a reduction along a specified tuple of axes, computing both the sum and product stored in the same output array. Its a bit of mess, but it does seem to work. Doing this kind of thing appears to take quite a lot of setup though.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the NpyIter and PyArray_IterAllButAxis API material and studying the linked gist's nested-iterator reduction example. Done means the documentation includes clear examples for multiple broadcasted arrays and similarly complex NpyIter usage, including the reduction scenario described.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.