I'm trying to code a for linear regression analysis that prints TypeError: can't multiply sequence by non-int of type 'list',.
I tried to learn linear regression coefficient analysis
def corr_coef(x,y):
N = len(x)
num = (N * (x * y).sum()) - (x.sum() * y.sum())
den = np.sqrt((N * (x**2).sum() - x.sum()**2) * (N * (y**2).sum() - y.sum()**2))
R = num / den
return R
num = (N * (x * y).sum()) - (x.sum() * y.sum())
TypeError: can't multiply sequence by non-int of type 'list'