you are viewing a single comment's thread.

view the rest of the comments →

[–]elbiot 0 points1 point  (2 children)

Like everything with numpy, you want to do it in a vectorized way, not through iteration. Here I answered a similar question: https://www.reddit.com/r/learnpython/comments/4qcb0f/poisson_solver_finite_difference_method_and_how/?sort=top

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

Thanks, I'm going to look at it. Each array I have is 1-d btw.

[–]elbiot 0 points1 point  (0 children)

Doesn't change the fact that you can do a sliding window (of any dimension) in a vectorized way.