Support for 'at' ufunc method
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 668
- Forks
- 141
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 4
Description
Is your feature request related to a problem? Please describe.
np.add.at(a, mask, b) is a replacement for a[mask] += b, except repeated indices will cause the addition to be performed as many times as they appear as opposed to just once. This ufunc method would be useful to support as using a for loop for this would be very costly.
Describe the solution you'd like
Add support for the at ufunc; currently a NotImplemented error is thrown when attempting to use np.add.at on sparse arrays.
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 at the sparse-array handling for np.add.at, where the issue reports a NotImplemented error. Determine the relevant entry point and add tests covering repeated indices; done means np.add.at works on sparse arrays with repeated indices instead of raising NotImplemented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100