Re: [Numpy-discussion] Covariance matrix from polyfit

2013-07-04 Thread josef . pktd
On Thu, Jul 4, 2013 at 8:01 PM, David Schaich wrote: > Hi all, > > I recently adopted python, and am in the process of replacing my old > analysis tools. For simple (e.g., linear) interpolations and > extrapolations, in the past I used gnuplot. Today I set up the > equivalent with polyfit in numpy

[Numpy-discussion] Covariance matrix from polyfit

2013-07-04 Thread David Schaich
Hi all, I recently adopted python, and am in the process of replacing my old analysis tools. For simple (e.g., linear) interpolations and extrapolations, in the past I used gnuplot. Today I set up the equivalent with polyfit in numpy v1.7.1, first running a simple test to reproduce the gnuplot

[Numpy-discussion] subtypes of ndarray and round()

2013-07-04 Thread Matti Picus
round() does not consistently preserve subtype of the ndarray, is this known behaviour or should I file a bug for it? Python 2.7.3 (default, Sep 26 2012, 21:51:14) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import numpy as np >>> np.version.v

Re: [Numpy-discussion] Equality not working as expected with ndarray sub-class

2013-07-04 Thread Frédéric Bastien
On Thu, Jul 4, 2013 at 9:12 AM, sebastian wrote: > On 2013-07-04 15:06, Thomas Robitaille wrote: > > Hi everyone, > > > > The following example: > > > > import numpy as np > > > > class SimpleArray(np.ndarray): > > > > __array_priority__ = 1 > > > > def __new__(cls, inp

Re: [Numpy-discussion] Equality not working as expected with ndarray sub-class

2013-07-04 Thread sebastian
On 2013-07-04 15:06, Thomas Robitaille wrote: > Hi everyone, > > The following example: > > import numpy as np > > class SimpleArray(np.ndarray): > > __array_priority__ = 1 > > def __new__(cls, input_array, info=None): > return np.asarray(input_array).vi

Re: [Numpy-discussion] Equality not working as expected with ndarray sub-class

2013-07-04 Thread Frédéric Bastien
Hi, __array__priority wasn't checked for ==, !=, <, <=, >, >= operation. I added it in the development version and someone else back-ported it to the 1.7.X branch. So this will work with the next release of numpy. I don't know of a workaround until the next release. Fred On Thu, Jul 4, 2013 a

[Numpy-discussion] Equality not working as expected with ndarray sub-class

2013-07-04 Thread Thomas Robitaille
Hi everyone, The following example: import numpy as np class SimpleArray(np.ndarray): __array_priority__ = 1 def __new__(cls, input_array, info=None): return np.asarray(input_array).view(cls) def __eq__(self, other): return False