numpy.gradient有什么作用? [英] What does numpy.gradient do?

查看:77
本文介绍了numpy.gradient有什么作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我知道(数学)函数的斜率是多少,所以我觉得我应该知道numpy.gradient的作用.但是我没有. 文档也不是很有帮助:

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 really helpful either:

返回N维数组的梯度.

Return the gradient of an N-dimensional array.

什么是数组的梯度? numpy.gradient什么时候有用?

What is the gradient of an array? When is numpy.gradient useful?

推荐答案

使用内部和内部的中心差计算梯度 边界上的第一个差异.

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

默认距离为1

The default distance is 1

意味着在内部将其计算为

其中h = 1.0

并在边界处

这篇关于numpy.gradient有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆