This is an online compiler that supports the NumPy library..

import numpy as np
b = [[1,2,3],[np.nan,np.nan,2]]
arr = np.array(b)
print(arr)
print(np.isnan(arr))
x = np.isnan(arr)
#replacing NaN values with 0
arr[x] = 0
print("After replacing NaN values:")
arr

If the code takes user input, put it here. For multiple inputs, one per line

NumPy is a widely used Python library that supports large, multidimensional arrays and metrics. Using NumPy, you can perform operations using a large collection of high-level mathematical functions to operate on arrays.

For scientific computing, linear algebra NumPy is the most loving library. It is very fast as it has binding C libraries in the backend.