**kwargs的意思
2019/10/14 02:00 上午
機器學習共學討論版
林佳瑩
觀看數:17
回答數:1
收藏數:0
ml100-3-d20
想問一下這個定義函數...
1.**kwargs 這是什麼呢? 為什麼需要這個設定?
2.另外,corr_func定義好的這個函數是找不到在哪裡有被使用?
-------------------------------------------------------------
檔案範例:
定義函數 : 計算兩個 column 之間的相關係數
def corr_func(x, y, **kwargs):
r = np.corrcoef(x, y)[0][1]
ax = plt.gca()
ax.annotate("r = {:.2f}".format(r),
xy=(.2, .8), xycoords=ax.transAxes,
size = 20)
---------------------------------------------------------------