Re: [Numpy-discussion] Polynomial evaluation inconsistencies

2018-07-02 Thread Maxwell Aifer
doesn't do anything reasonable). > > Chebyshev.literal(lambda T: 1*T[0] + 2*T[1] + 3*T[2]) > > Would work, but honestly I don't think that provides much clarity. I think > the value here is mainly for "simple" polynomials. > > On Sun, 1 Jul 2018 at 23:42 Ma

Re: [Numpy-discussion] Polynomial evaluation inconsistencies

2018-07-01 Thread Maxwell Aifer
Say we add a constructor to the polynomial base class that looks something like this: --- @classmethod def literal(cls, f): def basis_function_getter(self, deg): coefs = [0]*deg + [1

Re: [Numpy-discussion] Polynomial evaluation inconsistencies

2018-06-30 Thread Maxwell Aifer
*shouldn't the constructor call the lambda with Polynomial([0,1[) On Sat, Jun 30, 2018 at 6:05 PM, Maxwell Aifer wrote: > Oh, clever... yeah I think that would be very cool. But shouldn't it call > the constructor with Polynomial([0,1])? > > On Sat, Jun 30, 2018 at 5:41 PM

Re: [Numpy-discussion] Polynomial evaluation inconsistencies

2018-06-30 Thread Maxwell Aifer
Oh, clever... yeah I think that would be very cool. But shouldn't it call the constructor with Polynomial([0,1])? On Sat, Jun 30, 2018 at 5:41 PM, Eric Wieser wrote: > Since the one of the arguments for the decreasing order seems to just be > textual representation - do we want to tweak the repr

Re: [Numpy-discussion] Polynomial evaluation inconsistencies

2018-06-30 Thread Maxwell Aifer
Interesting, I wasn't aware that both conventions were widely used. Speaking of series with inverse powers (i.e. Laurent series), I wonder how useful it would be to create a class to represent expressions with integral powers from -m to n. These come up in my work sometimes, and I usually represe

Re: [Numpy-discussion] Polynomial evaluation inconsistencies

2018-06-30 Thread Maxwell Aifer
d clearer docs explaining the difference, and > pointing users to the more sensible `np.polynomial.Polynomial` > > Eric > > > > On Fri, 29 Jun 2018 at 20:10 Charles R Harris > wrote: > >> On Fri, Jun 29, 2018 at 8:21 PM, Maxwell Aifer >> wrote: >> >

[Numpy-discussion] Polynomial evaluation inconsistencies

2018-06-29 Thread Maxwell Aifer
Hi, I noticed some frustrating inconsistencies in the various ways to evaluate polynomials using numpy. Numpy has three ways of evaluating polynomials (that I know of) and each of them has a different syntax: - numpy.polynomial.polynomial.Polynomial