DEV Community

Punitha
Punitha

Posted on

Handling Invalid Values

NumPy arrays can sometimes contain special values

  • NaN → Not a Number

  • inf → Infinity

  • -inf → Negative Infinity

Step 1:

Output:

Replace Values

Step 1:

Output:

  • Nan -> 0 and inf -> 1

Output:

Top comments (0)