Pandas DataFrame ganti inf

df.replace([np.inf, -np.inf], np.nan)
Exuberant Eland