code :
import numpy from matplotlib.mlab import PCA file_name = \"store1_pca_matrix.txt\" ori_data = numpy.loadtxt(file_name,dtype=\'float\', comments=\'#\', de
Following on @c-chavez answer, what worked for me was first replacing inf and -inf to nan, then removing nan. For example:
data = data.replace(np.inf, np.nan).replace(-np.inf, np.nan).dropna()