Skip to content
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

NaN matcher for np.nan #15

Open
danodonovan opened this issue Nov 24, 2020 · 1 comment
Open

NaN matcher for np.nan #15

danodonovan opened this issue Nov 24, 2020 · 1 comment

Comments

@danodonovan
Copy link
Contributor

danodonovan commented Nov 24, 2020

How would you feel about a PR for a matcher that checked if a value was NaN (for the numpy definition of NaN)?

Perhaps something like is_nan() ? (and using np.isnan under the hood).

NB By design NaN != NaN so equal_to(np.nan) wouldn't work here.

@mwilliamson
Copy link
Owner

Hmm, anything that relies on numpy should probably go in a separate module. I'm not opposed in principle though.

The alternative would be to add a more general is_ matcher, so you can write is_(np.nan).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants