2-D array X may contain np.nan. Replace every NaN with the mean of its own column and return the result:
X
np.nan
Input
[[ 1. 2. nan] [nan 4. 6.] [ 5. nan 9.]]
Output
[[1. 2. 7.5] [3. 4. 6. ] [5. 3. 9. ]]
This one's part of Premium. Unlock the full NumPy track plus every other premium problem on the site.
solve(...)