pydata / pydata/sparse

Support for 'at' ufunc method

Open
#548 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.