Julia's numerical derivative following Numpy gradient
Julia's numerical derivative following Numpy gradient
gist.github.com Julia's numerical derivative following Numpy gradient
Julia's numerical derivative following Numpy gradient - gist:996e0745e820dde0610ada9e9e025844
![Julia's numerical derivative following Numpy gradient](https://programming.dev/pictrs/image/aabcaeac-f12f-42ff-b22a-1c4bc6481ed0.png?format=webp&thumbnail=256)
Victor Buendía (@[email protected]) writes:
Turns out that #julialang does not have the equivalent of Numpy's gradient function. So I went to Numpy docs and source code and adapted it.
Numpy's gradient is great because it uses centered differences, so it's way more accurate than naively getting the forward differences. Also, supports non-equally spaced grids.
In case someone needs it (for 1D arrays only), here it is:
https://gist.github.com/VictorSeven/996e0745e820dde0610ada9e9e025844
0 comments