bggbdZddlZddlZddlZddlZddlmZdgZ Gddej Z dS)a Abstract base class for the various polynomial Classes. The ABCPolyBase class provides the methods needed to implement the common API for the various polynomial classes. It operates as a mixin, but uses the abc module from the stdlib, hence it is only available for Python >= 2.6. N) polyutils ABCPolyBasec eZdZdZdZdZdZedddddd d d d d d Z eddddddddddd Z e j dk Z edZeejdZeejdZeejdZeejdZeejdZeejd Zeejd!Zeejdfd"Zeejd#Zeejd$Zeejd%Zeejd&Zeejd'Zeejd(Z eejd)Z!d*Z"d+Z#d,Z$d-Z%d.Z&dgd0Z'd1Z(d2Z)d3Z*d4Z+e,d5Z-e,d6Z.e,d7Z/edhd9Z0d:Z1d;Z2d<Z3d=Z4d>Z5d?Z6d@Z7dAZ8dBZ9dCZ:dDZ;dEZdHZ?dIZ@dJZAdKZBdLZCdMZDdNZEdOZFdPZGdQZHdRZIdSZJdTZKdUZLdVZMdidXZNdYZOdjdZZPd[ZQd\gdfd]ZRdkd^ZSd_ZTdld`ZUe, dmdaZVe,gdd/fdbZWe,dgdcZXe,dgddZYe,dndeZZdS)oraAn abstract base class for immutable series classes. ABCPolyBase provides the standard Python numerical methods '+', '-', '*', '//', '%', 'divmod', '**', and '()' along with the methods listed below. .. versionadded:: 1.9.0 Parameters ---------- coef : array_like Series coefficients in order of increasing degree, i.e., ``(1, 2, 3)`` gives ``1*P_0(x) + 2*P_1(x) + 3*P_2(x)``, where ``P_i`` is the basis polynomials of degree ``i``. domain : (2,) array_like, optional Domain to use. The interval ``[domain[0], domain[1]]`` is mapped to the interval ``[window[0], window[1]]`` by shifting and scaling. The default value is the derived class domain. window : (2,) array_like, optional Window, see domain for its use. The default value is the derived class window. symbol : str, optional Symbol used to represent the independent variable in string representations of the polynomial expression, e.g. for printing. The symbol must be a valid Python identifier. Default value is 'x'. .. versionadded:: 1.24 Attributes ---------- coef : (N,) ndarray Series coefficients in order of increasing degree. domain : (2,) ndarray Domain that is mapped to window. window : (2,) ndarray Window that domain is mapped to. symbol : str Symbol representing the independent variable. Class Attributes ---------------- maxpower : int Maximum power allowed, i.e., the largest number ``n`` such that ``p(x)**n`` is allowed. This is to limit runaway polynomial size. domain : (2,) ndarray Default domain of the class. window : (2,) ndarray Default window of the class. Ndu⁰¹²³u⁴u⁵u⁶u⁷u⁸u⁹) 0123456789u₀u₁u₂u₃u₄u₅u₆u₇u₈u₉ntc|jSN)_symbolselfs Q/opt/cloudlinux/venv/lib64/python3.11/site-packages/numpy/polynomial/_polybase.pysymbolzABCPolyBase.symbolns |cdSrrs rdomainzABCPolyBase.domainr  rcdSrrrs rwindowzABCPolyBase.windowwr!rcdSrrrs r basis_namezABCPolyBase.basis_name|r!rcdSrrc1c2s r_addzABCPolyBase._addr!rcdSrrr's r_subzABCPolyBase._subr!rcdSrrr's r_mulzABCPolyBase._mulr!rcdSrrr's r_divzABCPolyBase._divr!rcdSrr)cpowmaxpowers r_powzABCPolyBase._powr!rcdSrr)xr2s r_valzABCPolyBase._valr!rcdSrr)r2mklbndscls r_intzABCPolyBase._intr!rcdSrr)r2r:r=s r_derzABCPolyBase._derr!rcdSrr)r7ydegrcondfulls r_fitzABCPolyBase._fitr!rcdSrr)offr=s r_linezABCPolyBase._liner!rcdSrr)r2s r_rootszABCPolyBase._rootsr!rcdSrr)rs r _fromrootszABCPolyBase._fromrootsr!rct|jt|jkrdStj|j|jksdSdS)aGCheck if coefficients match. .. versionadded:: 1.6.0 Parameters ---------- other : class instance The other class must have the ``coef`` attribute. Returns ------- bool : boolean True if the coefficients are the same, False otherwise. FT)lencoefnpallrothers r has_samecoefzABCPolyBase.has_samecoefsI ty>>S__ , ,5 UZ/00 54rcFtj|j|jkS)a?Check if domains match. .. versionadded:: 1.6.0 Parameters ---------- other : class instance The other class must have the ``domain`` attribute. Returns ------- bool : boolean True if the domains are the same, False otherwise. )rRrSr rTs rhas_samedomainzABCPolyBase.has_samedomain vdkU\1222rcFtj|j|jkS)a?Check if windows match. .. versionadded:: 1.6.0 Parameters ---------- other : class instance The other class must have the ``window`` attribute. Returns ------- bool : boolean True if the windows are the same, False otherwise. )rRrSr#rTs rhas_samewindowzABCPolyBase.has_samewindowrYrc,t||jS)aCheck if types match. .. versionadded:: 1.7.0 Parameters ---------- other : object Class instance. Returns ------- bool : boolean True if other is same class as self ) isinstance __class__rTs r has_sametypezABCPolyBase.has_sametypes %000rct|trt||jstdt j|j|jkstdt j|j|jkstd|j|jkrtd|j S|S)aInterpret other as polynomial coefficients. The `other` argument is checked to see if it is of the same class as self with identical domain and window. If so, return its coefficients, otherwise return `other`. .. versionadded:: 1.9.0 Parameters ---------- other : anything Object to be checked. Returns ------- coef The coefficients of`other` if it is a compatible instance, of ABCPolyBase, otherwise `other`. Raises ------ TypeError When `other` is an incompatible instance of ABCPolyBase. zPolynomial types differzDomains differzWindows differzPolynomial symbols differ) r]rr^ TypeErrorrRrSr r#r ValueErrorrQrTs r_get_coefficientszABCPolyBase._get_coefficients s4 e[ ) ) eT^44 > 9:::VDK5<788 > 0111VDK5<788 > 0111 ,, !<===:  rr7ctj|gd\}||_|Btj|gd\}t|dkrt d||_|Btj|gd\}t|dkrt d||_ |st dn#t$rtdwxYw||_ dS)NFtrimz$Domain has wrong number of elements.z$Window has wrong number of elements.z/Symbol string must be a valid Python identifierz!Symbol must be a non-empty string) pu as_seriesrQrPrbr r# isidentifierAttributeErrorrar)rrQr r#rs r__init__zABCPolyBase.__init__0stf5111  |VH5999HV6{{a !GHHH DK  |VH5999HV6{{a !GHHH DK A&&((  E  A A A?@@ @ A s *#CC(c t|jdd}t|jdd}t|jdd}|jj}|d|d|d|d|jd S)N(z , domain=z , window=z , symbol='z'))reprrQr r#r^__name__r)rrQr r#names r__repr__zABCPolyBase.__repr__NsDIqt$dk""1R4(dk""1R4(~&++$++++&++;+++ ,rc|dkr|S|dvrtd|d|jd|dkr||jS||jS)N)asciiunicodezUnsupported format string 'z ' passed to z4.__format__. Valid options are 'ascii' and 'unicode'rw)__str__rbr^_generate_string_str_term_ascii_str_term_unicode)rfmt_strs r __format__zABCPolyBase.__format__Vs b==<<>> ! . . .)g))>)))  g  (()=>> >$$T%;<<> q==Iodil++ 122//  GAt 3JCAJJE  (199 %T(J(J(J JII %d(K(K(K KI ( ( ('KK  ( UDK88 8I399T??2.//#i..@H3ty}%%)))A 9$$%--c4;; 9 CC s :CCCc~|jtdd|j||jd|dS)z String representation of single polynomial term using unicode characters for superscripts and subscripts. NzZSubclasses must define either a basis_name, or override _str_term_unicode(cls, i, arg_str)·rp))r%NotImplementedError translate_subscript_mappingclsrarg_strs rr|zABCPolyBase._str_term_unicodesc > !%5 S^Q[[1G%H%H rcP|jtdd|jd|d|dS)z String representation of a single polynomial term using ** and _ to represent superscripts and subscripts, respectively. NzXSubclasses must define either a basis_name, or override _str_term_ascii(cls, i, arg_str)r_rprr%rrs rr{zABCPolyBase._str_term_asciisH > !%3 33>22A222222rcP|jtdd|jd|d|dS)NzbSubclasses must define either a basis name, or override _repr_latex_term(i, arg_str, needs_parens){z}_{z}(rr)rrr needs_parenss r_repr_latex_termzABCPolyBase._repr_latex_termsF > !%=>> >:CN9999w9999rFcTdtj||S)Nz \text{{{}}}r)formatrhr)r7rs r_repr_latex_scalarzABCPolyBase._repr_latex_scalars'$$R_Qv%F%F%FGGGrc|\}}|dkr|dkr |j}d}n|dkr"||d|j}d}n]|dkr!|||j}d}n6||d|||j}d}dj}g}t |jD]\}}|dkr||} n~t |tjsd||d} nJtj |sd||d } nd || d } | |||} | d kr| } n| d | } |dkr || } | | |rd |} nd} d|jd| dS)NrrFz + Tz\color{{LightGray}}{{{}}}z + (rrz - r z\,rvr $z \mapsto )mapparmsrrrrrQr]numbersRealrRsignbitrappendjoin) rrHscaletermrmutepartsrr2coef_strterm_strpartbodys r _repr_latex_zABCPolyBase._repr_latex_s_]]__ U !88 ;D LL aZZ--c22DDt{DDDLL AXX--e44CdkCCDLL**3//AA**511A37;AA  L+2di((  DAqAvv"55a88:7<00 L?$"9"9!"<"<???Z]] LJ!8!84!8!H!HJJK!8!8!D!8!I!IKK,,QlCCH3#11x11AvvtDzz LL      775>>DDD1DK11$1111rc|j}|j|d<|j|d<|j|d<|j|d<|S)NrQr r#r)__dict__copyrQr r#r)rrets r __getstate__zABCPolyBase.__getstate__shm  ""inn&&F  ((**H  ((**H  H  rc||_dSr)r)rdicts r __setstate__zABCPolyBase.__setstate__s  rctj|j|j\}}|||zz}|||jSr)rhrr r#r8rQ)rargrHr=s r__call__zABCPolyBase.__call__s>;t{DK88SCGmyydi(((rc*t|jSr)iterrQrs r__iter__zABCPolyBase.__iter__sDIrc*t|jSr)rPrQrs r__len__zABCPolyBase.__len__s49~~rc\||j |j|j|jSrr^rQr r#rrs r__neg__zABCPolyBase.__neg__ s+~~ YJ T[$+   rc|Srrrs r__pos__zABCPolyBase.__pos__s rc||} ||j|}n#t$r tcYSwxYw|||j|j|jSr) rcr*rQ ExceptionNotImplementedr^r r#rrrU othercoefrQs r__add__zABCPolyBase.__add__v**511  "99TY 22DD " " "! ! ! ! "~~dDKdkJJJ3AAc||} ||j|}n#t$r tcYSwxYw|||j|j|jSr) rcr,rQrrr^r r#rrs r__sub__zABCPolyBase.__sub__rrc||} ||j|}n#t$r tcYSwxYw|||j|j|jSr) rcr.rQrrr^r r#rrs r__mul__zABCPolyBase.__mul__#rrct|tjrt|tr0t dt |dt |d||S)Nz&unsupported types for true division: 'z', '')r]rNumberboolratype __floordiv__rTs r __truediv__zABCPolyBase.__truediv__+s%00 Jud4K4K 3JJ33$(KK333   '''rcR||}|tur|S|dSNr __divmod__rrrUress rrzABCPolyBase.__floordiv__6,ooe$$ . J1v rcR||}|tur|S|dSNrrrs r__mod__zABCPolyBase.__mod__<rrcR||} ||j|\}}n!#t$rt$r t cYSwxYw|||j|j|j }|||j|j|j }||fSr) rcr0rQZeroDivisionErrorrrr^r r#r)rrUrquorems rrzABCPolyBase.__divmod__Bs**511  "yyI66HC      " " "! ! ! ! "nnS$+t{DKHHnnS$+t{DKHHCxs6AAc||j||j}|||j|j|j}|S)N)r4)r5rQr4r^r r#r)rrUrQrs r__pow__zABCPolyBase.__pow__Ns?yyEDMyBBnnT4; T[II rc |||j}n#t$r tcYSwxYw|||j|j|jSr)r*rQrrr^r r#rrrUrQs r__radd__zABCPolyBase.__radd__Sc "99UDI..DD " " "! ! ! ! "~~dDKdkJJJ 22c |||j}n#t$r tcYSwxYw|||j|j|jSr)r,rQrrr^r r#rrs r__rsub__zABCPolyBase.__rsub__Zrrc |||j}n#t$r tcYSwxYw|||j|j|jSr)r.rQrrr^r r#rrs r__rmul__zABCPolyBase.__rmul__arrc,||Sr) __rfloordiv__rTs r__rdiv__zABCPolyBase.__rdiv__hs!!%(((rctSr)rrTs r __rtruediv__zABCPolyBase.__rtruediv__ls rcR||}|tur|S|dSr __rdivmod__rrs rrzABCPolyBase.__rfloordiv__q.u%% . J1v rcR||}|tur|S|dSrrrs r__rmod__zABCPolyBase.__rmod__wrrc( |||j\}}n!#t$rt$r tcYSwxYw|||j|j|j}|||j|j|j}||fSr) r0rQrrrr^r r#r)rrUrrs rrzABCPolyBase.__rdivmod__}s "yy 22HC      " " "! ! ! ! "nnS$+t{DKHHnnS$+t{DKHHCxs !??cPt||jotj|j|jkomtj|j|jkoK|jj|jjko1tj|j|jko|j|jk}|Sr) r]r^rRrSr r#rQshaperrs r__eq__zABCPolyBase.__eq__s%00-vdkU\122-vdkU\122- 5:#33-vdi5:-.. -  u|+  rc.|| Sr)rrTs r__ne__zABCPolyBase.__ne__s;;u%%%%rcZ||j|j|j|jS)zoReturn a copy. Returns ------- new_series : series Copy of self. rrs rrzABCPolyBase.copys$~~didk4;OOOrc&t|dz S)uThe degree of the series. .. versionadded:: 1.5.0 Returns ------- degree : int Degree of the series, one less than the number of coefficients. Examples -------- Create a polynomial object for ``1 + 7*x + 4*x**2``: >>> poly = np.polynomial.Polynomial([1, 7, 4]) >>> print(poly) 1.0 + 7.0·x + 4.0·x² >>> poly.degree() 2 Note that this method does not check for non-zero coefficients. You must trim the polynomial to remove any trailing zeroes: >>> poly = np.polynomial.Polynomial([1, 7, 0]) >>> print(poly) 1.0 + 7.0·x + 0.0·x² >>> poly.degree() 2 >>> poly.trim().degree() 1 r)rPrs rdegreezABCPolyBase.degreesB4yy1}rc2||dzS)aTruncate series to the given degree. Reduce the degree of the series to `deg` by discarding the high order terms. If `deg` is greater than the current degree a copy of the current series is returned. This can be useful in least squares where the coefficients of the high degree terms may be very small. .. versionadded:: 1.5.0 Parameters ---------- deg : non-negative int The series is reduced to degree `deg` by discarding the high order terms. The value of `deg` must be a non-negative integer. Returns ------- new_series : series New instance of series with reduced degree. r)truncate)rrCs rcutdegzABCPolyBase.cutdegs.}}S1W%%%rrctj|j|}|||j|j|jS)aRemove trailing coefficients Remove trailing coefficients until a coefficient is reached whose absolute value greater than `tol` or the beginning of the series is reached. If all the coefficients would be removed the series is set to ``[0]``. A new series instance is returned with the new coefficients. The current instance remains unchanged. Parameters ---------- tol : non-negative number. All trailing coefficients less than `tol` will be removed. Returns ------- new_series : series New instance of series with trimmed coefficients. )rhtrimcoefrQr^r r#r)rtolrQs rrfzABCPolyBase.trims5({49c**~~dDKdkJJJrct|}||ks|dkrtd|t|jkr|j}n|jd|}|||j|j|jS)aTruncate series to length `size`. Reduce the series to length `size` by discarding the high degree terms. The value of `size` must be a positive integer. This can be useful in least squares where the coefficients of the high degree terms may be very small. Parameters ---------- size : positive int The series is reduced to length `size` by discarding the high degree terms. The value of `size` must be a positive integer. Returns ------- new_series : series New instance of series with truncated coefficients. rzsize must be a positive integerN)intrbrPrQr^r r#r)rsizeisizerQs rrzABCPolyBase.truncatesy(D  D==EAII>?? ? C NN " "9DD9VeV$D~~dDKdkJJJrc||j}||j}||j}|||||jS)aConvert series to a different kind and/or domain and/or window. Parameters ---------- domain : array_like, optional 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 ------- new_series : series The returned class can be of different type than the current instance and/or have a different domain and/or different window. Notes ----- Conversion between domains and class types can result in numerically ill defined series. N)r#r)r^r r#identityr)rr kindr#s rconvertzABCPolyBase.convertsL: <>D >[F >[FtDMM& MLLMMMrc@tj|j|jS)aReturn the mapping parameters. The returned values define a linear map ``off + scl*x`` that is applied to the input arguments before the series is evaluated. The map depends on the ``domain`` and ``window``; if the current ``domain`` is equal to the ``window`` the resulting map is the identity. If the coefficients of the series instance are to be used by themselves outside this class, then the linear function must be substituted for the ``x`` in the standard representation of the base polynomials. Returns ------- off, scl : float or complex The mapping function is defined by ``off + scl*x``. Notes ----- If the current domain is the interval ``[l1, r1]`` and the window is ``[l2, r2]``, then the linear mapping function ``L`` is defined by the equations:: L(l1) = l2 L(r1) = r2 )rhrr r#rs rrzABCPolyBase.mapparms8s6{4; 444rrc|\}}|d}n|||zz}||j|||d|z }|||j|j|jS)aIntegrate. Return a series instance that is the definite integral of the current series. Parameters ---------- m : non-negative int The number of integrations to perform. k : array_like Integration constants. The first constant is applied to the first integration, the second to the second, and so on. The list of values must less than or equal to `m` in length and any missing values are set to zero. lbnd : Scalar The lower bound of the definite integral. Returns ------- new_series : series A new series representing the integral. The domain is the same as the domain of the integrated series. Nrg?)rr>rQr^r r#r)rr:r;r<rHr=rQs rintegzABCPolyBase.integUsk2==??S <DDT>DyyAq$377~~dDKdkJJJrc|\}}||j||}|||j|j|jS)aDifferentiate. Return a series instance of that is the derivative of the current series. Parameters ---------- m : non-negative int Find the derivative of order `m`. Returns ------- new_series : series A new series representing the derivative. The domain is the same as the domain of the differentiated series. )rr@rQr^r r#r)rr:rHr=rQs rderivzABCPolyBase.derivvsJ$==??SyyAs++~~dDKdkJJJrcv||j}tj||j|jS)a/Return the roots of the series polynomial. Compute the roots for the series. Note that the accuracy of the roots decreases the further outside the `domain` they lie. Returns ------- roots : ndarray Array containing the roots of the series. )rKrQrh mapdomainr#r )rrootss rr#zABCPolyBase.rootss/ DI&&|E4; <<[F Kq 6!9a 0 0 DGG!t rc V|tj|}n0t|turt |dkr|j}||j}tj|||} || |||||} |r| \} } || ||| | fS| } || ||| S)a0 Least squares fit to data. Return a series instance that is the least squares fit to the data `y` sampled at `x`. The domain of the returned instance can be specified and this will often result in a superior fit with less chance of ill conditioning. Parameters ---------- x : array_like, shape (M,) x-coordinates of the M sample points ``(x[i], y[i])``. y : array_like, shape (M,) y-coordinates of the M sample points ``(x[i], y[i])``. deg : int or 1-D array_like Degree(s) of the fitting polynomials. If `deg` is a single integer all terms up to and including the `deg`'th term are included in the fit. For NumPy versions >= 1.11.0 a list of integers specifying the degrees of the terms to include may be used instead. domain : {None, [beg, end], []}, optional Domain to use for the returned series. If ``None``, then a minimal domain that covers the points `x` is chosen. If ``[]`` the class domain is used. The default value was the class domain in NumPy 1.4 and ``None`` in later versions. The ``[]`` option was added in numpy 1.5.0. rcond : float, optional Relative condition number of the fit. Singular values smaller than this relative to the largest singular value will be ignored. The default value is len(x)*eps, where eps is the relative precision of the float type, about 2e-16 in most cases. full : bool, optional Switch determining nature of return value. When it is False (the default) just the coefficients are returned, when True diagnostic information from the singular value decomposition is also returned. w : array_like, shape (M,), optional Weights. If not None, the weight ``w[i]`` applies to the unsquared residual ``y[i] - y_hat[i]`` at ``x[i]``. Ideally the weights are chosen so that the errors of the products ``w[i]*y[i]`` all have the same variance. When using inverse-variance weighting, use ``w[i] = 1/sigma(y[i])``. The default value is None. .. versionadded:: 1.5.0 window : {[beg, end]}, optional Window to use for the returned series. The default value is the default class domain .. versionadded:: 1.6.0 symbol : str, optional Symbol representing the independent variable. Default is 'x'. Returns ------- new_series : series A series that represents the least squares fit to the data and has the domain and window specified in the call. If the coefficients for the unscaled and unshifted basis polynomials are of interest, do ``new_series.convert().coef``. [resid, rank, sv, rcond] : list These values are only returned if ``full == True`` - resid -- sum of squared residuals of the least squares fit - rank -- the numerical rank of the scaled Vandermonde matrix - sv -- singular values of the scaled Vandermonde matrix - rcond -- value of `rcond`. For more details, see `linalg.lstsq`. Nr)wrDrEr r#r) rh getdomainrlistrPr r#r"rF)rr7rBrCr rDrEr(r#rxnewrrQstatuss rfitzABCPolyBase.fitsR >\!__FF &\\T ! !c&kkQ&6&6ZF >ZF|Avv..hhtQqDhAA  J NT6DvFFF D3tF6&III Irctj|gd\}|tj|}n0t|turt |dkr|j}||j}t |}tj||\}}|||zz}| |||zz } || |||S)aReturn series instance that has the specified roots. Returns a series representing the product ``(x - r[0])*(x - r[1])*...*(x - r[n-1])``, where ``r`` is a list of roots. Parameters ---------- roots : array_like List of roots. domain : {[], None, array_like}, optional Domain for the resulting series. If None the domain is the interval from the smallest root to the largest. If [] the domain is the class domain. The default is []. window : {None, array_like}, optional Window for the returned series. If None the class window is used. The default is None. symbol : str, optional Symbol representing the independent variable. Default is 'x'. Returns ------- new_series : series Series with the specified roots. FreNrr)) rhrir*rr+rPr r#rrN) rr#r r#rrCrHr=rnewrQs r fromrootszABCPolyBase.fromrootss8,wU333 >\%((FF &\\T ! !c&kkQ&6&6ZF >ZF%jj;vv..SSY~~d##c3h.s4vfEEEErc||j}||j}tj||\}}|||}|||||S)aIdentity function. If ``p`` is the returned series, then ``p(x) == x`` for all values of x. Parameters ---------- domain : {None, array_like}, optional If given, the array must be of the form ``[beg, end]``, where ``beg`` and ``end`` are the endpoints of the domain. If None is given then the class domain is used. The default is None. window : {None, array_like}, optional If given, the resulting array must be if the form ``[beg, end]``, where ``beg`` and ``end`` are the endpoints of the window. If None is given then the class window is used. The default is None. symbol : str, optional Symbol representing the independent variable. Default is 'x'. Returns ------- new_series : series Series of representing the identity. )r r#rhrrI)rr r#rrHr=rQs rrzABCPolyBase.identityBsZ6 >ZF >ZF;vv..Syyc""s4000rc||j}||j}t|}||ks|dkrtd|dg|zdgz|||S)a\Series basis polynomial of degree `deg`. Returns the series representing the basis polynomial of degree `deg`. .. versionadded:: 1.7.0 Parameters ---------- deg : int Degree of the basis polynomial for the series. Must be >= 0. domain : {None, array_like}, optional If given, the array must be of the form ``[beg, end]``, where ``beg`` and ``end`` are the endpoints of the domain. If None is given then the class domain is used. The default is None. window : {None, array_like}, optional If given, the resulting array must be if the form ``[beg, end]``, where ``beg`` and ``end`` are the endpoints of the window. If None is given then the class window is used. The default is None. symbol : str, optional Symbol representing the independent variable. Default is 'x'. Returns ------- new_series : series A series with the coefficient of the `deg` term set to one and all others zero. Nrz deg must be non-negative integerr)r r#rrb)rrCr r#ridegs rbasiszABCPolyBase.basisesi> >ZF >ZF3xx 3;;$((?@@ @sA3t8qc>666:::rcT||j}||j}||||S)aConvert 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. .. versionadded:: 1.7.0 Parameters ---------- series : series The series instance to be converted. domain : {None, array_like}, optional If given, the array must be of the form ``[beg, end]``, where ``beg`` and ``end`` are the endpoints of the domain. If None is given then the class domain is used. The default is None. window : {None, array_like}, optional If given, the resulting array must be if the form ``[beg, end]``, where ``beg`` and ``end`` are the endpoints of the window. If None is given then the class window is used. The default is None. Returns ------- new_series : series A series of the same kind as the calling class and equal to `series` when evaluated. See Also -------- convert : similar instance method )r r#r)rseriesr r#s rcastzABCPolyBase.casts3H >ZF >ZF~~fc6222rr)NNr7)F)r)NNN)r)rN)NNFNNr7)NN)[rr __module__ __qualname____doc____hash____array_ufunc__r4r maketrans_superscript_mappingrosrsrpropertyrabcabstractmethodr r#r% staticmethodr*r,r.r0r5r8r>r@rFrIrKrNrVrXr[r_rcrlrtr~ryrz classmethodr|r{rrrrrrrrrrrrrrrrrrrrrrrrrrrr rr rrfrrrrr r#r%r.r1rr5r8rrrrrs11hHOH==           * *             ( (   w$&L X  X   X   X   \   \   \   \    \   \   \   \   \   \   \   \ .333$333$111$$$$L<,,, = = =;;; $$$L   [   3 3[ 3::[:HHH\H 323232r )))     KKKKKKKKK ( ( (     KKKKKKKKK)))     &&& P P P!!!F&&&2KKKK.KKK:#N#N#N#NJ555:2DKKKKBKKKK, = = =@CGYJYJYJ[YJv%'S(F(F(F[(FT 1 1 1[ 1D&;&;&;[&;P'3'3'3['3'3'3r) r;r@rBrnumpyrRrvrrh__all__ABCrrrrrIs  /d3d3d3d3d3#'d3d3d3d3d3r