BUG: assert_equal fails on object arrays of nan
Open
Nobody has claimed this yet.
00 - Bug
component: numpy.testing
- Dominant language
- Python
- Stars
- 32.8k
- Forks
- 12.8k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 197
Description
The following fails:
import numpy as np
from numpy.testing import assert_equal
a = np.array([1, 2, np.nan], object)
assert_equal(a, a)
AssertionError:
Arrays are not equal
(mismatch 33.33333333333333%)
x: array([1, 2, nan], dtype=object)
y: array([1, 2, nan], dtype=object)
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 reproducer and tracing the numpy.testing.assert_equal entry point for object arrays containing nan. Confirm the expected equality behavior and identify the existing test location for assert_equal; done means the reproducer passes with regression coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100