-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Description
Hi, I was checking on the new function corr to see how it works and found the following while typing help(corr) in the Demo
corr([2, 4, 6, 8], [1, 2, 3, 6])
# yields TypeError: Unexpected type of argument in function matrix (expected: string or Array or Matrix or boolean, actual: number, index: 0)It works correctly by adding a dimension:
corr([[2, 4, 6, 8]], [[1, 2, 3, 6]])
# yields [0.95618288746751]Nonetheless outside the parser it works as expected regarding if it's a 1D array
math.corr([2, 4, 6, 8], [1, 2, 3, 6])
// yields 0.9561828874675149Also noticed that the second example includes the function matrix which is by default in the parser.
corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))
# yields [0.95699416885036, 1]So this could also work with a bit of simplification.
corr([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]], [[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]])
# or
corr([1, 2.2, 3, 4.8, 5; 1, 2, 3, 4, 5], [4, 5.3, 6.6, 7, 8; 1, 2, 3, 4, 5])
# yields [0.95699416885036, 1]The function corr is really cool, just wanted to let you know of these issues in the parser.
Reactions are currently unavailable