What does numpy.gradient do?

后端 未结 4 1532
旧巷少年郎
旧巷少年郎 2020-12-23 02:15

So I know what the gradient of a (mathematical) function is, so I feel like I should know what numpy.gradient does. But I don\'t. The documentation is not reall

4条回答
  •  执笔经年
    2020-12-23 02:46

    The gradient is computed using central differences in the interior and first differences at the boundaries.

    and

    The default distance is 1

    This means that in the interior it is computed as

    enter image description here

    where h = 1.0

    and at the boundaries

    enter image description here

提交回复
热议问题