summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
diff options
context:
space:
mode:
authorHelder Cesar <heldercro@gmail.com>2015-04-05 22:26:57 -0300
committerHelder Cesar <heldercro@gmail.com>2015-04-05 22:26:57 -0300
commitb5645433f6322c9d491cc0fbddf71ea0aa84fcd9 (patch)
tree5dda9401c4c9fd011797e3af3b8f7fac3e660d38 /numpy/lib/function_base.py
parent8b858d1ba2203fda94f0f60d41d6502e855437b1 (diff)
downloadnumpy-b5645433f6322c9d491cc0fbddf71ea0aa84fcd9.tar.gz
DOC: Return of gradient() function
This is an improve of documentation for gradient() funcion as commented in #5628
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r--numpy/lib/function_base.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index 9aec98cc8..ccf5bcfc0 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -918,6 +918,10 @@ def gradient(f, *varargs, **kwargs):
>>> np.gradient(x, 2)
array([ 0.5 , 0.75, 1.25, 1.75, 2.25, 2.5 ])
+ For two dimensional arrays, the return will be two arrays ordered by
+ axis. In this example the first array stands for the gradient in
+ rows and the second one in columns direction:
+
>>> np.gradient(np.array([[1, 2, 6], [3, 4, 5]], dtype=np.float))
[array([[ 2., 2., -1.],
[ 2., 2., -1.]]), array([[ 1. , 2.5, 4. ],