array must not contain infs or nans

Solutions on MaxInterview for array must not contain infs or nans by the best coders in the world

showing results for - "array must not contain infs or nans"
César
01 Jan 2021
1#Please check if any of your values being passed in are NaN or inf:
2np.isnan(x).any()
3np.isnan(y).any()
4
5np.isinf(x).any()
6np.isinf(y).any()
7
8#If any of those yields true. Remove the nan entries or inf entries.