drop nan in numpy array code example
Example 1: how to delete nan values in python
x = x[~numpy.isnan(x)]
Example 2: python remove nan rows
df = df[df['my_var'].notna()]
Example 3: remove nans and infs python
df.replace([np.inf, -np.inf], np.nan).dropna(axis=1)
Example 4: numpy remove nan rows
a[ ~np.isnan(a).any(axis=1),:]