Hi,
The new Polynomial objects includes a domain and window. How can I
normalize such an object to a standard domain and window? There is the
.convert method, but it returns a strange format. A minimal example:
import numpy as np
p =np.polynomial.Polynomial([1, 1])
x=np.linspace(0, 3, 15);
y=p(x)
y[1]+=.1
q=np.polynomial.Polynomial.fit(x, y, 1)
print(f'p: {repr(p)}')
print(f'fitted q: {repr(q)}')
print(f'fitted q: {str(q)}')
qc=q.convert()
print(f'q.convert(): str {qc}')
print(f'q.convert(): {repr(qc)}')
The output of repr(qc) is:
Polynomial([Polynomial([1.02166667, 0.99 ], domain=[-1., 1.],
window=[-1., 1.])],
dtype=object, domain=[-1., 1.], window=[-1., 1.])
but I am looking for:
Polynomial([1.02166667, 0.99 ], domain=[-1., 1.], window=[-1., 1.])
With kind regards,
Pieter Eendebak
_______________________________________________
NumPy-Discussion mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: [email protected]