What does numpy.gradient do?

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

Leave a Comment