Replace the missing (NaN) entries of a numeric vector with the mean of the observed entries.
Implement solve(x).
Returns. Return a new NumPy array; the input is not modified.
Example 1
Input:
solve([1.0, np.nan, 3.0])
Output:
[1.0, 2.0, 3.0]
Example 2
Input:
solve([np.nan, 4.0, 6.0, np.nan])
Output:
[5.0, 4.0, 6.0, 5.0]
No results yet
Run your code to check it against the examples, or submit to run every test.