ValueError: Input contains NaN, infinity or a value too large for dtype('float32').
解决办法:
https://www.kaggle.com/c/word2vec-nlp-tutorial/forums/t/11266/valueerror-array-contains-nan-or-infinity
Just for the record, I had the same error message and found that it was caused by NaN's. I imputed them as follows:
from sklearn.preprocessing import Imputer
df = Imputer().fit_transform(df)
后面就可以继续使用df做机器学习模型建模了