[SciPy-user] question about scipy.polynomial.poly1d

Alan G Isaac aisaac at american.edu
Fri Dec 16 15:42:16 CST 2005

On Fri, 16 Dec 2005, Michael Blazej apparently wrote: 
> Okay instead of the output of print poly1d([1,2,3]) 
> x^2+2x+3 
> is there a way to change the variable to something arbitrary like 
> y^2+2y+3 

Oh, you mean in the string representation.
Presumably you could override, but may
it's good enough to:

    >>> print str(p).replace('x','y')
    3 y + 1 y + 2

Alan Isaac

More information about the SciPy-user mailing list