-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Labels
Description
As a side note that probably should be the topic of another issue: When looking into this issue I noticed that sc.nanmin and sc.min does the same thing
# Both return -1
sc.array(dims=['x'], values=[1, float('nan'), -1]).min()
sc.array(dims=['x'], values=[1, float('nan'), -1]).nanmin()while
# Only nanmin returns -1
np.min([1, float('nan'), -1])
np.nanmin([1, float('nan'), -1])I think the reason is that in the implementation of sc.min we use std::min(a, b) equivalent to (b < a) ? b : a; and if b=nan we get a.
Originally posted by @jokasimr in #3287 (review)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done