Retire los nans e infs python
x = x[numpy.logical_not(numpy.isnan(x))]
Fantastic Fly
x = x[numpy.logical_not(numpy.isnan(x))]
df.replace([np.inf, -np.inf], np.nan).dropna(axis=1)