天天看點

成功解決AttributeError: ‘function‘ object has no attribute ‘fit‘

解決問題

   sns.distplot(data_frame[cols[0]],  

               ax = axes[0],

               kde = False, norm_hist = False,  

               rug = True,  

#                 fit=norm,                         # fit 可結合scipy庫在圖像上做拟合,拟合标準正态分布

               vertical = False,    

               label='dis',        

                )    

 File "F:\Python36\lib\site-packages\seaborn\distributions.py", line 2641, in distplot

   params = fit.fit(a)

AttributeError: 'function' object has no attribute 'fit'

解決思路

屬性錯誤:“function”對象沒有“fit”屬性

解決方法

1、猜想是否包的版本較低

經過檢視庫版本,發現并非包版本問題導緻!

2、其它方法正在嘗試!

正在嘗試解決!