SyntaxFix
Write A Post
Hire A Developer
Questions
I have been using this successfully, where x and y are array-like.
def rsquared(x, y): """ Return R^2 where x and y are array-like.""" slope, intercept, r_value, p_value, std_err = scipy.stats.linregress(x, y) return r_value**2