MCPcopy Index your code
hub / github.com/numpy/numpy / cast

Method cast

numpy/polynomial/_polybase.py:1154–1191  ·  view source on GitHub ↗

Convert series to series of this class. The `series` is expected to be an instance of some polynomial series of one of the types supported by by the numpy.polynomial module, but could be some other class that supports the convert method. Parameters -

(cls, series, domain=None, window=None)

Source from the content-addressed store, hash-verified

1152
1153 @classmethod
1154 def cast(cls, series, domain=None, window=None):
1155 """Convert series to series of this class.
1156
1157 The `series` is expected to be an instance of some polynomial
1158 series of one of the types supported by by the numpy.polynomial
1159 module, but could be some other class that supports the convert
1160 method.
1161
1162 Parameters
1163 ----------
1164 series : series
1165 The series instance to be converted.
1166 domain : {None, array_like}, optional
1167 If given, the array must be of the form ``[beg, end]``, where
1168 ``beg`` and ``end`` are the endpoints of the domain. If None is
1169 given then the class domain is used. The default is None.
1170 window : {None, array_like}, optional
1171 If given, the resulting array must be if the form
1172 ``[beg, end]``, where ``beg`` and ``end`` are the endpoints of
1173 the window. If None is given then the class window is used. The
1174 default is None.
1175
1176 Returns
1177 -------
1178 new_series : series
1179 A series of the same kind as the calling class and equal to
1180 `series` when evaluated.
1181
1182 See Also
1183 --------
1184 convert : similar instance method
1185
1186 """
1187 if domain is None:
1188 domain = cls.domain
1189 if window is None:
1190 window = cls.window
1191 return series.convert(domain, cls, window)

Callers 4

test_castFunction · 0.45
test_fromrootsFunction · 0.45
test_integFunction · 0.45
test_callFunction · 0.45

Calls 1

convertMethod · 0.80

Tested by 4

test_castFunction · 0.36
test_fromrootsFunction · 0.36
test_integFunction · 0.36
test_callFunction · 0.36