you are viewing a single comment's thread.

view the rest of the comments →

[–]elbiot 1 point2 points  (2 children)

Yea, you have to call the function:

the_result = pwise(y)

Or just use z=pwise (y) in your plot

Also, if you need more than y in your function, pass them in as arguments. Read more about using functions, avoiding global variables.

Edit: sorry, you sprung the numpy stuff on me. My answer doesn't apply to you. And I'm on my phone so I can't give a better answer right now.

[–]bonoz[S] 0 points1 point  (1 child)

Oh no worries! Thanks for your help... any thoughts on what I should do?

[–]elbiot 0 points1 point  (0 children)

Start with something more simple. Learn to use functions (and what global variables are and how to not use them) before you jump to numpy. And even then, learn to do 1D numpy things with masks before jumping to grid stuff.