nditer usage with index and buffered flags
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 32.8k
- Forks
- 12.8k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 197
Description
When using a nditer with any kind of index flag like 'c_index', 'f_index' or 'multi_index', the index will always be zero if the 'buffered' flag is used as well. If this is intended behavior, it does not seem to be documented though.
Reproducing code example:
a = np.arange(4*4*3).reshape(4,4,3)
it = np.nditer(a, flags=['multi_index', 'buffered'])
while not it.finished:
print(it.multi_index)
it.iternext()
Numpy/Python version information:
numpy version: 1.17.0
python version: 3.7.4 (default, Jul 9 2019, 18:13:23) [Clang 10.0.1 (clang-1001.0.46.4)]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided nditer example with the reported NumPy and Python versions, then trace the nditer handling for the multi_index, c_index, f_index, and buffered flags. Determine whether the zero indices are intended or incorrect, and finish by documenting the behavior or adding a regression test and fix based on that decision.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100