remove nan in numpy array code example Example 1: delete nans in df python df[~np.isnan(df)] Example 2: remove nana from np array x = x[~numpy.isnan(x)]