Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ENH: Add a np.isnan loop for the object dtype (and possible isfinite, ...) #9009

Open
@eric-wieser

Description

@eric-wieser

This would fix help fix #9008.

From most to least-well defined

  1. Object arrays of float,np.float32, np.datetime64... → return np.isnan(item)
  2. Object arrays of int,np.int32, ... → return False
  3. Object arrays of any type that implements __float__ or __int__ - return np.isnan(float(x))
  4. Object arrays of np.ndarrayreturn np.isnan(item) (requires a O->O loop, not O->?)
  5. Any value → return x != x

I think I'd draw the line after 3, and have 4 onwards throw an error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions