Hey julians. I found this one a little tricky to fix. I have a rosenbrock function that takes 2 values and returns 1 value. So I was trying to run this as a comprehension, but I am getting out a (401,401) array, instead of a (401,1) array. Here is the code.
x = -2:0.01:2 y = -2:0.01:2 rosenbrock(x,p) = (p - x)^2 + p * (x - x^2)^2 z = [rosenbrock([i, j], p) for i=x, j=y]
But I keep getting out a (401,401) array instead of a 401,1 array. Now it makes sense that the comprehension is iterating over the
j dimensions, so there are probably repeated entries. But still I was not clear on how to fix this. I tried parenthesis
Note that the original poster on Slack cannot see your response here on Discourse. Consider transcribing the appropriate answer back to Slack, or pinging the poster here on Discourse so they can follow this thread.
(Original message ) (More Info)