Re: [Numpy-discussion] Idea: fractional polynomial class

2009-04-24 Thread josef . pktd
On Fri, Apr 24, 2009 at 10:43 PM, Robert Kern wrote: > On Fri, Apr 24, 2009 at 21:42,   wrote: >> 2009/4/24 Stéfan van der Walt : >>> 2009/4/24 Pauli Virtanen : polyint fixed in r6883, there doesn't seem anything else to fix: >>> import numpy as np >>> from fractions import Fract

Re: [Numpy-discussion] Idea: fractional polynomial class

2009-04-24 Thread Robert Kern
On Fri, Apr 24, 2009 at 21:42, wrote: > 2009/4/24 Stéfan van der Walt : >> 2009/4/24 Pauli Virtanen : >>> polyint fixed in r6883, there doesn't seem anything else to fix: >>> >> import numpy as np >> from fractions import Fraction >> a = np.poly1d([Fraction(4,19), Fraction(3,19), Frac

Re: [Numpy-discussion] Idea: fractional polynomial class

2009-04-24 Thread josef . pktd
2009/4/24 Stéfan van der Walt : > 2009/4/24 Pauli Virtanen : >> polyint fixed in r6883, there doesn't seem anything else to fix: >> > import numpy as np > from fractions import Fraction > a = np.poly1d([Fraction(4,19), Fraction(3,19), Fraction(2,19), 0]) > > Very cool.  I think we shoul

Re: [Numpy-discussion] Idea: fractional polynomial class

2009-04-24 Thread Stéfan van der Walt
2009/4/24 Pauli Virtanen : > polyint fixed in r6883, there doesn't seem anything else to fix: > import numpy as np from fractions import Fraction a = np.poly1d([Fraction(4,19), Fraction(3,19), Fraction(2,19), 0]) Very cool. I think we should mention thi example in the docs as well?

Re: [Numpy-discussion] Idea: fractional polynomial class

2009-04-24 Thread Pauli Virtanen
Fri, 24 Apr 2009 19:04:50 +, Pauli Virtanen wrote: > Well, Numpy's poly1d will work fine with minor changes, so I see no > reason not to make sure we're consistent with duck typing. polyint fixed in r6883, there doesn't seem anything else to fix: >>> import numpy as np >>> from fractions impo

Re: [Numpy-discussion] Idea: fractional polynomial class

2009-04-24 Thread Pauli Virtanen
Fri, 24 Apr 2009 12:49:36 -0600, Charles R Harris wrote: [clip] > I tend to think that this sort of thing belongs to a specialized package > like sympy or sage. The polynomial class in numpy is a quick and dirty > convenience class for numerical computation. Well, Numpy's poly1d will work fine wit

Re: [Numpy-discussion] Idea: fractional polynomial class

2009-04-24 Thread Charles R Harris
On Fri, Apr 24, 2009 at 11:09 AM, Pauli Virtanen wrote: > Hi, > > Fri, 24 Apr 2009 12:52:33 -0400, Michael S. Gilbert kirjoitti: > > I've been working with numpy's poly1d class recently, and it would be > > very useful to me if the class worked with fractions instead of floats > > (since I'm enco

Re: [Numpy-discussion] Idea: fractional polynomial class

2009-04-24 Thread Pauli Virtanen
Hi, Fri, 24 Apr 2009 12:52:33 -0400, Michael S. Gilbert kirjoitti: > I've been working with numpy's poly1d class recently, and it would be > very useful to me if the class worked with fractions instead of floats > (since I'm encountering quantities that often mostly cancel out, which > lead to ins

[Numpy-discussion] Idea: fractional polynomial class

2009-04-24 Thread Michael S. Gilbert
Hello, I've been working with numpy's poly1d class recently, and it would be very useful to me if the class worked with fractions instead of floats (since I'm encountering quantities that often mostly cancel out, which lead to instabilities in my algorithms; hence it would be useful to use fractio