summaryrefslogtreecommitdiff
path: root/numpy/polynomial/polytemplate.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/polynomial/polytemplate.py')
-rw-r--r--numpy/polynomial/polytemplate.py40
1 files changed, 29 insertions, 11 deletions
diff --git a/numpy/polynomial/polytemplate.py b/numpy/polynomial/polytemplate.py
index 657b48508..3763123dc 100644
--- a/numpy/polynomial/polytemplate.py
+++ b/numpy/polynomial/polytemplate.py
@@ -25,6 +25,10 @@ import numpy as np
class $name(pu.PolyBase) :
"""A $name series class.
+ $name instances provide the standard Python numerical methods '+',
+ '-', '*', '//', '%', 'divmod', '**', and '()' as well as the listed
+ methods.
+
Parameters
----------
coef : array_like
@@ -60,10 +64,10 @@ class $name(pu.PolyBase) :
Notes
-----
- It is important to specify the domain for many uses of graded polynomial,
- for instance in fitting data. This is because many of the important
- properties of the polynomial basis only hold in a specified interval and
- thus the data must be mapped into that domain in order to benefit.
+ It is important to specify the domain in many cases, for instance in
+ fitting data, because many of the important properties of the
+ polynomial basis only hold in a specified interval and consequently
+ the data must be mapped into that interval in order to benefit.
Examples
--------
@@ -408,13 +412,12 @@ class $name(pu.PolyBase) :
def copy(self) :
"""Return a copy.
- A new instance of $name is returned that has the same
- coefficients and domain as the current instance.
+ Return a copy of the current $name instance.
Returns
-------
new_instance : $name
- New instance of $name with the same coefficients and domain.
+ Copy of current instance.
"""
return self.__class__(self.coef, self.domain, self.window)
@@ -514,12 +517,15 @@ class $name(pu.PolyBase) :
Parameters
----------
domain : array_like, optional
- The domain of the new series type instance. If the value is None,
- then the default domain of `kind` is used.
+ The domain of the converted series. If the value is None,
+ the default domain of `kind` is used.
kind : class, optional
The polynomial series type class to which the current instance
should be converted. If kind is None, then the class of the
current instance is used.
+ window : array_like, optional
+ The window of the converted series. If the value is None,
+ the default window of `kind` is used.
Returns
-------
@@ -767,9 +773,21 @@ class $name(pu.PolyBase) :
@staticmethod
def fromroots(roots, domain=$domain, window=$domain) :
- """Return $name object with specified roots.
+ """Return $name instance with specified roots.
+
+ Returns an instance of $name representing the product
+ ``(x - r[0])*(x - r[1])*...*(x - r[n-1])``, where ``r`` is the
+ list of roots.
- See ${nick}fromroots for full documentation.
+ Parameters
+ ----------
+ roots : array_like
+ List of roots.
+
+ Returns
+ -------
+ object : $name
+ Series with the specified roots.
See Also
--------