Repository navigation
docs: explain fill-value propagation in where - #987
Merged
Merged
Conversation
Clarify how element-wise operations determine their output fill value and illustrate both boolean fill-value branches of np.where from issue pydata#871. Assisted-by: OpenAI Codex (model: GPT-6, autonomous) Signed-off-by: 李永祺 <[email protected]>
hameerabbasi
approved these changes
Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this? (check all applicable)
Related issues
Closes #871.
Checklist
Please explain your changes below.
Explain in the COO examples that element-wise operations compute the output fill value by applying the operation to the input fill values, with scalars contributing their own values. This replaces the previous description in terms of a dense result.
Add both
np.wherecases from #871, showing the comparison's boolean fill value, the resulting COO fill value and the dense values. On an identity array with fill value zero, replacing ones withNaNpreserves the implicit zeros; replacing values less than one changes the implicit zeros toNaN. No runtime behavior changes.Validation on main at
6aaba13fa7951da0ea4a656cb10b2c103fbb7035, using Python 3.12.14 and NumPy 2.5.3:python -m pytest --doctest-modules sparse/numba_backend/_coo/core.py -o addopts='' -q: 24 passed, 1 skipped.pre-commit run --all-files: passed.mkdocs build: passed, including execution of the configured tutorial examples. The non-strict build emits parameter-reference, duplicate-anchor and dependency/kernel warnings outside the added examples.git diff --check: passed.Prepared with OpenAI Codex assistance; the examples and checks above were executed locally against this checkout.