remove nans from np array code example
Example 1: how to delete nan values in python
x = x[~numpy.isnan(x)]
Example 2: remove nans and infs python
x = x[numpy.logical_not(numpy.isnan(x))]
x = x[~numpy.isnan(x)]
x = x[numpy.logical_not(numpy.isnan(x))]