Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Index can be created with multiple NaNs#320

flexatone started this conversation inGeneral
Discussion options

This was first identified in#242. An isolated example is below.

>>> sf.Index((1, np.nan)).union(np.array((np.nan,)))<Index>1.0nannan
You must be logged in to vote

Replies: 3 comments

Comment options

flexatone
Sep 6, 2020
Maintainer Author

This is in part due to an issue in AutoMap:

brandtbucher/automap#5

You must be logged in to vote
0 replies
Comment options

flexatone
Sep 6, 2020
Maintainer Author

This is also due to an issue in how NumPy chooses not to handle NaNs in some operations;

>>> np.union1d(np.array((1, np.nan)), np.array((np.nan,)))array([ 1., nan, nan])>>> np.unique((np.array((1, np.nan, np.nan))))array([ 1., nan, nan])

This appears to be a 10-year old issue:
numpy/numpy#2111

You must be logged in to vote
0 replies
Comment options

flexatone
Sep 8, 2020
Maintainer Author

As this is an issue common todict as well asAutoMap, as it stands presently this is expected, though confusing behavior for a mapping object. I think the only option, from SF's perspective, is to consider disallowing NaNs inIndex, though that option will cost performance.

>>>dict.fromkeys(np.array((np.nan,np.nan))){nan:None,nan:None}
You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
1 participant
@flexatone
Converted from issue

This discussion was converted from issue #245 on February 18, 2021 19:12.


[8]ページ先頭

©2009-2025 Movatter.jp