summaryrefslogtreecommitdiff
path: root/numpy/lib
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib')
-rw-r--r--numpy/lib/function_base.py11
-rw-r--r--numpy/lib/polynomial.py3
-rw-r--r--numpy/lib/twodim_base.py4
3 files changed, 15 insertions, 3 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index 5ca797864..19037d975 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -1128,6 +1128,17 @@ def interp(x, xp, fp, left=None, right=None):
>>> np.interp(3.14, xp, fp, right=UNDEF)
-99.0
+ Plot an interpolant to the sine function:
+
+ >>> x = np.linspace(0, 2*np.pi, 10)
+ >>> y = np.sin(x)
+ >>> xvals = np.linspace(0, 2*np.pi, 50)
+ >>> yinterp = np.interp(xvals, x, y)
+ >>> import matplotlib.pyplot as plt
+ >>> plt.plot(x, y, 'o')
+ >>> plt.plot(xvals, yinterp, '-x')
+ >>> plt.show()
+
"""
if isinstance(x, (float, int, number)):
return compiled_interp([x], xp, fp, left, right).item()
diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py
index bce7f0e4e..7e3a02107 100644
--- a/numpy/lib/polynomial.py
+++ b/numpy/lib/polynomial.py
@@ -277,7 +277,7 @@ def polyint(p, m=1, k=None):
def polyder(p, m=1):
"""
- Return the derivative of order m of a polynomial.
+ Return the derivative of the specified order of a polynomial.
Parameters
----------
@@ -295,6 +295,7 @@ def polyder(p, m=1):
See Also
--------
polyint : Anti-derivative of a polynomial.
+ poly1d : Class for one-dimensional polynomials.
Examples
--------
diff --git a/numpy/lib/twodim_base.py b/numpy/lib/twodim_base.py
index 69eecbd87..cc33923ad 100644
--- a/numpy/lib/twodim_base.py
+++ b/numpy/lib/twodim_base.py
@@ -165,14 +165,14 @@ def eye(N, M=None, k=0, dtype=float):
Number of columns in the output. If None, defaults to `N`.
k : int, optional
Index of the diagonal: 0 refers to the main diagonal, a positive value
- refers to an upper diagonal and a negative value to a lower diagonal.
+ refers to an upper diagonal, and a negative value to a lower diagonal.
dtype : dtype, optional
Data-type of the returned array.
Returns
-------
I : ndarray (N,M)
- An array where all elements are equal to zero, except for the k'th
+ An array where all elements are equal to zero, except for the `k`-th
diagonal, whose values are equal to one.
See Also