[Numpy-discussion] numpy.polynomial.Polynomial

josef.pktd@gmai... josef.pktd@gmai...
Fri Oct 22 10:51:07 CDT 2010

I'm subclassing numpy.polynomial.Polynomial. So far it works well.

One question on inplace changes

Is it safe to change coef directly without creating a new instance?
I'm not trying to change anything else in the polynomial, just for
example pad, truncate or invert the coef inplace, e.g

def pad(self, maxlag):
    self.coef = np.r_[self.coef, np.zeros(maxlag - len(self.coef))]

Currently, I have rewritten this to return a new instance.



More information about the NumPy-Discussion mailing list