numpy / numpy/numpy

BUG: assert_equal fails on object arrays of nan

Open
#9,023 1 comment 0 reactions 0 assignees View on GitHub

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.