sns.heatmap画图的时候 TypeError: ufunc 'isnan' not supported for the input types 错误的处理

https://datascience.stackexchange.com/questions/32981/how-to-deal-with-typeerror-ufunc-isnan-not-supported-for-the-input-types

老外告诉我答案。。。。。

 是这样的我画的是pandas  的DataFrame 的类型。然后问题就在于我的数据是float的,但是我的特征是object于是就引发了上述的错误于是我 

                df[list(da.columns)]=df[list(df.columns)].astype(float)

 

然后问题完美解决,这个问题第一次遇到,在中文网站也找不到答案,因此特此记录

你可能感兴趣的:(sns.heatmap画图的时候 TypeError: ufunc 'isnan' not supported for the input types 错误的处理)