Skip to content

COMPAT: TestUnique.test_first_nan_kept failed for Python 3.10.0b1 #41367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fangchenli opened this issue May 7, 2021 · 2 comments
Closed

COMPAT: TestUnique.test_first_nan_kept failed for Python 3.10.0b1 #41367

fangchenli opened this issue May 7, 2021 · 2 comments
Labels
Bug Compat pandas objects compatability with Numpy or Python functions Python 3.10

Comments

@fangchenli
Copy link
Member

________________________ TestUnique.test_first_nan_kept ________________________

self = <pandas.tests.test_algos.TestUnique object at 0x7efe1274c760>

    def test_first_nan_kept(self):
        # GH 22295
        # create different nans from bit-patterns:
        bits_for_nan1 = 0xFFF8000000000001
        bits_for_nan2 = 0x7FF8000000000001
        NAN1 = struct.unpack("d", struct.pack("=Q", bits_for_nan1))[0]
        NAN2 = struct.unpack("d", struct.pack("=Q", bits_for_nan2))[0]
        assert NAN1 != NAN1
        assert NAN2 != NAN2
        for el_type in [np.float64, object]:
            a = np.array([NAN1, NAN2], dtype=el_type)
            result = pd.unique(a)
>           assert result.size == 1
E           assert 2 == 1
E            +  where 2 = array([nan, nan], dtype=object).size

pandas/tests/test_algos.py:798: AssertionError

Note: I cannot reproduce it on M1 mac.

@fangchenli fangchenli added Bug Compat pandas objects compatability with Numpy or Python functions Python 3.10 labels May 7, 2021
@realead
Copy link
Contributor

realead commented Jun 18, 2021

I think it was fixed with #41988.

@fangchenli
Copy link
Member Author

I think it was fixed with #41988.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Compat pandas objects compatability with Numpy or Python functions Python 3.10
Projects
None yet
Development

No branches or pull requests

2 participants