Tolerance argument for `da.isin()`?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
Is your feature request related to a problem? Please describe.
Sometimes you want to check that data values are present in another array, but only up to a certain tolerance.
Describe the solution you'd like
da.isin(test_values, tolerance=1e-6), where the tolerance argument is optional.
Not sure what the implementation should be but there are two vectorized suggestions here.
Describe alternatives you've considered
Different to np.isclose because isin compares all values against a flattened array, whereas isclose compares individual values elementwise.
Additional context
@jbusecke requested it.
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 locating the DataArray isin entry point and review the linked vectorized suggestions. Compare its flattened-array behavior with np.isclose, then define and test the optional tolerance behavior, including the default path.
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