From e5a5c7a90feeafe8596bb3e6ce9d587282a572f5 Mon Sep 17 00:00:00 2001 From: zolboo1024 Date: Fri, 5 Feb 2021 14:55:43 -0500 Subject: Specified the return type for trapz to include the possibility of ndarray being returned --- numpy/lib/function_base.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'numpy/lib/function_base.py') diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 276ffa5d4..d33a0fa7d 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -4100,9 +4100,12 @@ def trapz(y, x=None, dx=1.0, axis=-1): Returns ------- - trapz : float - Definite integral as approximated by trapezoidal rule. - + trapz : float or ndarray + Definite integral of 'y' = n-dimensional array as approximated along + a single axis by the trapezoidal rule. If 'y' is a 1-dimensional array, + then the result is a float. If 'n' is greater than 1, then the result + is an 'n-1' dimensional array. + See Also -------- sum, cumsum @@ -4245,7 +4248,7 @@ def meshgrid(*xi, copy=True, sparse=False, indexing='xy'): See Also -------- mgrid : Construct a multi-dimensional "meshgrid" using indexing notation. - ogrid : Construct an open multi-dimensional "meshgrid" using indexing + ogrid : Construct an open multi-dimensional "meshgrid" using indexing notation. Examples -- cgit v1.2.1