天天看點

成功解決AttributeError: ‘JointGrid‘ object has no attribute ‘annotate‘

解決問題

Traceback (most recent call last):

 File "F:\test2021011.py", line 60, in <module>

   JointGridScatterPlot(col_nums02,data_frame)

 File "F:\site-packages\DataVisualize_Functions2D.py", line 222, in JointGridScatterPlot

   fg.annotate(stats.pearsonr)

AttributeError: 'JointGrid' object has no attribute 'annotate'

解決思路

屬性錯誤:'JointGrid'對象沒有'annotate'屬性

解決方法

   fg=sns.JointGrid(x=cols[0],y=cols[1],data=data_frame,)

   fg=fg.plot_joint(plt.scatter,color='m',edgecolor='white')            

JointGrid類中沒有該方法,建議更新或者更新包的版本。

繼續閱讀