[Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Matthew Brett
Hi, Running the test suite for one of our libraries, there seems to have been a recent breakage of the behavior of dtype hashing. This script: import numpy as np data0 = np.arange(10) data1 = data0 - 10 dt0 = data0.dtype dt1 = data1.dtype assert dt0 == dt1 # always passes assert hash(dt0) ==

[Numpy-discussion] Multiple Linear Regression

2011-03-16 Thread dileep kunjaai
Dear sir, Can we do multiple linear regression(MLR) in python is there any inbuilt function for MLR -- DILEEPKUMAR. R J R F, IIT DELHI ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] 1.6: branching and release notes

2011-03-16 Thread Mark Wiebe
On Tue, Mar 15, 2011 at 8:29 PM, Ralf Gommers ralf.gomm...@googlemail.comwrote: On Wed, Mar 16, 2011 at 2:31 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Mar 15, 2011 at 12:26 PM, Mark Wiebe mwwi...@gmail.com wrote: On Sun, Mar 13, 2011 at 11:59 PM, Ralf Gommers

[Numpy-discussion] OpenOpt Suite release 0.33

2011-03-16 Thread Dmitrey
Hi all, I'm glad to inform you about new release 0.33 of our completely free (license: BSD) cross-platform software: OpenOpt: * cplex has been connected * New global solver interalg with guarantied precision, competitor to LGO, BARON, MATLAB's intsolver and

Re: [Numpy-discussion] 1.6: branching and release notes

2011-03-16 Thread Mark Wiebe
On Tue, Mar 15, 2011 at 10:42 PM, Ralf Gommers ralf.gomm...@googlemail.comwrote: On Wed, Mar 16, 2011 at 11:29 AM, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Wed, Mar 16, 2011 at 2:31 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Mar 15, 2011 at 12:26 PM,

Re: [Numpy-discussion] 1.6: branching and release notes

2011-03-16 Thread Ralf Gommers
On Wed, Mar 16, 2011 at 4:16 PM, Mark Wiebe mwwi...@gmail.com wrote: On Tue, Mar 15, 2011 at 10:42 PM, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Wed, Mar 16, 2011 at 11:29 AM, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Wed, Mar 16, 2011 at 2:31 AM, Charles R Harris

[Numpy-discussion] convert dictionary of arrays into single array

2011-03-16 Thread John
Hello, I have a dictionary with structured arrays, keyed by integers 0...n. There are no other keys in the dictionary. What is the most efficient way to convert the dictionary of arrays to a single array? All the arrays have the same 'headings' and width, but different lengths. Is there

Re: [Numpy-discussion] Multiple Linear Regression

2011-03-16 Thread Angus McMorland
On 16 March 2011 02:53, dileep kunjaai dileepkunj...@gmail.com wrote: Dear sir,  Can we do multiple linear regression(MLR)  in python is there any inbuilt function for MLR Yes, you can use np.linalg.lstsq [1] for this. Here's a quick example: import numpy as np # model is y = b0.x0 +

Re: [Numpy-discussion] Fortran was dead ... [was Re: rewriting NumPy code in C or C++ or similar]

2011-03-16 Thread Sturla Molden
Den 16.03.2011 00:01, skrev Neal Becker: Here is how Fortran compares: * 1-d, 2-d only or N-d?? Any of those. * support for slice views? What exactly kind of support? Fortran 90 pointers create a view. real*8, target :: array(n,m) real*8, pointer :: view view = array(::2, ::2) Slicing

[Numpy-discussion] When was the ddof kwarg added to std()?

2011-03-16 Thread Darren Dale
Does anyone know when the ddof kwarg was added to std()? Has it always been there? Thanks, Darren ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Multiple Linear Regression

2011-03-16 Thread dileep kunjaai
Thank you for your time and consideration. On Wed, Mar 16, 2011 at 5:17 PM, Angus McMorland amcm...@gmail.com wrote: On 16 March 2011 02:53, dileep kunjaai dileepkunj...@gmail.com wrote: Dear sir, Can we do multiple linear regression(MLR) in python is there any

Re: [Numpy-discussion] When was the ddof kwarg added to std()?

2011-03-16 Thread Scott Sinclair
On 16 March 2011 14:52, Darren Dale dsdal...@gmail.com wrote: Does anyone know when the ddof kwarg was added to std()? Has it always been there? Does 'git log --grep=ddof' help? Cheers, Scott ___ NumPy-Discussion mailing list

[Numpy-discussion] *= operator not intuitive

2011-03-16 Thread Paul Anton Letnes
Hi! This little snippet of code tricked me (in a more convoluted form). The *= operator does not change the datatype of the left hand side array. Is this intentional? It did fool me and throw my results quite a bit off. I always assumed that 'a *= b' means exactly the same as 'a = a * b' but

Re: [Numpy-discussion] *= operator not intuitive

2011-03-16 Thread Angus McMorland
On 16 March 2011 09:24, Paul Anton Letnes paul.anton.let...@gmail.com wrote: Hi! This little snippet of code tricked me (in a more convoluted form). The *= operator does not change the datatype of the left hand side array. Is this intentional? It did fool me and throw my results quite a bit

Re: [Numpy-discussion] *= operator not intuitive

2011-03-16 Thread Dag Sverre Seljebotn
On 03/16/2011 02:24 PM, Paul Anton Letnes wrote: Hi! This little snippet of code tricked me (in a more convoluted form). The *= operator does not change the datatype of the left hand side array. Is this intentional? It did fool me and throw my results quite a bit off. I always assumed

Re: [Numpy-discussion] Multiple Linear Regression

2011-03-16 Thread Skipper Seabold
On Wed, Mar 16, 2011 at 2:53 AM, dileep kunjaai dileepkunj...@gmail.com wrote: Dear sir,  Can we do multiple linear regression(MLR)  in python is there any inbuilt function for MLR You might be interested in statsmodels http://statsmodels.sourceforge.net/ Skipper

Re: [Numpy-discussion] *= operator not intuitive

2011-03-16 Thread Paul Anton Letnes
Heisann! On 16. mars 2011, at 14.30, Dag Sverre Seljebotn wrote: On 03/16/2011 02:24 PM, Paul Anton Letnes wrote: Hi! This little snippet of code tricked me (in a more convoluted form). The *= operator does not change the datatype of the left hand side array. Is this intentional? It did

Re: [Numpy-discussion] *= operator not intuitive

2011-03-16 Thread Charles R Harris
On Wed, Mar 16, 2011 at 7:24 AM, Paul Anton Letnes paul.anton.let...@gmail.com wrote: Hi! This little snippet of code tricked me (in a more convoluted form). The *= operator does not change the datatype of the left hand side array. Is this intentional? It did fool me and throw my results

Re: [Numpy-discussion] When was the ddof kwarg added to std()?

2011-03-16 Thread Charles R Harris
On Wed, Mar 16, 2011 at 6:52 AM, Darren Dale dsdal...@gmail.com wrote: Does anyone know when the ddof kwarg was added to std()? Has it always been there? IIRC, a few years back there was a long thread on the list about unbiased vs biased estimates of std and ddof may have been added then...

Re: [Numpy-discussion] When was the ddof kwarg added to std()?

2011-03-16 Thread Darren Dale
On Wed, Mar 16, 2011 at 9:10 AM, Scott Sinclair scott.sinclair...@gmail.com wrote: On 16 March 2011 14:52, Darren Dale dsdal...@gmail.com wrote: Does anyone know when the ddof kwarg was added to std()? Has it always been there? Does 'git log --grep=ddof' help? Yes: March 7, 2008 Thanks

Re: [Numpy-discussion] Fortran was dead ... [was Re: rewriting NumPy code in C or C++ or similar]

2011-03-16 Thread Neal Becker
Sturla Molden wrote: Den 16.03.2011 13:25, skrev Sturla Molden: Fortran 90 pointers create a view. real*8, target :: array(n,m) real*8, pointer :: view view = array(::2, ::2) Pardon, the second line should be real*8, pointer :: view(:,:) Sturla Also: * can it adopt external

Re: [Numpy-discussion] convert dictionary of arrays into single array

2011-03-16 Thread John Salvatier
Loop through to build a list of arrays, then use vstack on the list. On Wed, Mar 16, 2011 at 1:36 AM, John washa...@gmail.com wrote: Hello, I have a dictionary with structured arrays, keyed by integers 0...n. There are no other keys in the dictionary. What is the most efficient way to

Re: [Numpy-discussion] Fortran was dead ... [was Re: rewriting NumPy code in C or C++ or similar]

2011-03-16 Thread Yung-Yu Chen
On Wed, Mar 16, 2011 at 09:46, Neal Becker ndbeck...@gmail.com wrote: Sturla Molden wrote: Den 16.03.2011 13:25, skrev Sturla Molden: Fortran 90 pointers create a view. real*8, target :: array(n,m) real*8, pointer :: view view = array(::2, ::2) Pardon, the second line

Re: [Numpy-discussion] convert dictionary of arrays into single array

2011-03-16 Thread Bruce Southey
On 03/16/2011 08:56 AM, John Salvatier wrote: Loop through to build a list of arrays, then use vstack on the list. On Wed, Mar 16, 2011 at 1:36 AM, John washa...@gmail.com mailto:washa...@gmail.com wrote: Hello, I have a dictionary with structured arrays, keyed by integers 0...n.

Re: [Numpy-discussion] convert dictionary of arrays into single array

2011-03-16 Thread John Salvatier
I think he wants to stack them (same widths) so stacking them should be fine. On Wed, Mar 16, 2011 at 7:30 AM, Bruce Southey bsout...@gmail.com wrote: On 03/16/2011 08:56 AM, John Salvatier wrote: Loop through to build a list of arrays, then use vstack on the list. On Wed, Mar 16, 2011 at

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Robert Kern
On Wed, Mar 16, 2011 at 01:18, Matthew Brett matthew.br...@gmail.com wrote: Hi, Running the test suite for one of our libraries, there seems to have been a recent breakage of the behavior of dtype hashing. This script: import numpy as np data0 = np.arange(10) data1 = data0 - 10 dt0 =

Re: [Numpy-discussion] *= operator not intuitive

2011-03-16 Thread Chris Barker
On 3/16/11 6:34 AM, Charles R Harris wrote: On Wed, Mar 16, 2011 at 7:24 AM, Paul Anton Letnes Yes, it is intentional. Numpy is more C than Python in this case, I don't know that C has anything to do with it -- the *= operators were added specifically to be in-place operators -- otherwise

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Charles R Harris
On Wed, Mar 16, 2011 at 8:46 AM, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 16, 2011 at 01:18, Matthew Brett matthew.br...@gmail.com wrote: Hi, Running the test suite for one of our libraries, there seems to have been a recent breakage of the behavior of dtype hashing.

Re: [Numpy-discussion] *= operator not intuitive

2011-03-16 Thread Dag Sverre Seljebotn
On 03/16/2011 02:35 PM, Paul Anton Letnes wrote: Heisann! Hei der, On 16. mars 2011, at 14.30, Dag Sverre Seljebotn wrote: On 03/16/2011 02:24 PM, Paul Anton Letnes wrote: Hi! This little snippet of code tricked me (in a more convoluted form). The *= operator does not change the

Re: [Numpy-discussion] *= operator not intuitive

2011-03-16 Thread Paul Anton Letnes
On 16. mars 2011, at 15.49, Chris Barker wrote: On 3/16/11 6:34 AM, Charles R Harris wrote: On Wed, Mar 16, 2011 at 7:24 AM, Paul Anton Letnes Yes, it is intentional. Numpy is more C than Python in this case, I don't know that C has anything to do with it -- the *= operators were added

Re: [Numpy-discussion] *= operator not intuitive

2011-03-16 Thread Paul Anton Letnes
On 16. mars 2011, at 15.57, Dag Sverre Seljebotn wrote: On 03/16/2011 02:35 PM, Paul Anton Letnes wrote: Heisann! Hei der, On 16. mars 2011, at 14.30, Dag Sverre Seljebotn wrote: On 03/16/2011 02:24 PM, Paul Anton Letnes wrote: Hi! This little snippet of code tricked me (in a more

Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-16 Thread René Dudfield
pygame On Sat, Mar 12, 2011 at 9:08 AM, Nadav Horesh nad...@visionsense.comwrote: Having numpy, scipy, and matplotlib working reasonably with python3, a major piece of code I miss for a major python3 migration is an image IO. I found that pylab's imread works fine for png image, but I need

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Charles R Harris
On Wed, Mar 16, 2011 at 8:56 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Mar 16, 2011 at 8:46 AM, Robert Kern robert.k...@gmail.comwrote: On Wed, Mar 16, 2011 at 01:18, Matthew Brett matthew.br...@gmail.com wrote: Hi, Running the test suite for one of our libraries,

Re: [Numpy-discussion] *= operator not intuitive

2011-03-16 Thread Charles R Harris
On Wed, Mar 16, 2011 at 8:58 AM, Paul Anton Letnes paul.anton.let...@gmail.com wrote: On 16. mars 2011, at 15.49, Chris Barker wrote: On 3/16/11 6:34 AM, Charles R Harris wrote: On Wed, Mar 16, 2011 at 7:24 AM, Paul Anton Letnes Yes, it is intentional. Numpy is more C than Python in

Re: [Numpy-discussion] Is this a bug in repr ?

2011-03-16 Thread Mark Sienkiewicz
In that case, would you agree that it is a bug for assert_array_almost_equal to use repr() to display the arrays, since it is printing identical values and saying they are different? Or is there also a reason to do that? It should probably use np.array_repr(x, precision=16) Ok,

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Robert Kern
On Wed, Mar 16, 2011 at 10:27, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Mar 16, 2011 at 8:56 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Mar 16, 2011 at 8:46 AM, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 16, 2011 at 01:18, Matthew Brett

Re: [Numpy-discussion] *= operator not intuitive

2011-03-16 Thread Paul Anton Letnes
This comes up for discussion on a fairly regular basis. I tend towards the more warnings side myself, but you aren't going to get the current behavior changed unless you can convince a large bunch of people that it is the right thing to do, which won't be easy. For one thing, a lot of

[Numpy-discussion] Numpy 1.5.1 test failures

2011-03-16 Thread Mark Dixon
Hi, Sorry if this is a noob question, but I've been trying to install Numpy for a while now and I keep having problems getting it to pass the test suite. I'm on a RHEL5 system, building against Python 2.6.5 (self-built with GCC 4.1.2), gfortran 4.1.2 and MKL 10.3 Update 2 (shipped with Intel

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Matthew Brett
Hi, On Wed, Mar 16, 2011 at 9:21 AM, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 16, 2011 at 10:27, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Mar 16, 2011 at 8:56 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Mar 16, 2011 at 8:46 AM, Robert Kern

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Robert Kern
On Wed, Mar 16, 2011 at 11:43, Matthew Brett matthew.br...@gmail.com wrote: I can git-bisect it later in the day, will do so unless it's become clear in the meantime. I'm almost done bisecting. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Robert Kern
On Wed, Mar 16, 2011 at 11:55, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 16, 2011 at 11:43, Matthew Brett matthew.br...@gmail.com wrote: I can git-bisect it later in the day, will do so unless it's become clear in the meantime. I'm almost done bisecting.

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Mark Wiebe
On Wed, Mar 16, 2011 at 10:00 AM, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 16, 2011 at 11:55, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 16, 2011 at 11:43, Matthew Brett matthew.br...@gmail.com wrote: I can git-bisect it later in the day, will do so unless it's

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Robert Kern
On Wed, Mar 16, 2011 at 12:15, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Mar 16, 2011 at 10:00 AM, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 16, 2011 at 11:55, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 16, 2011 at 11:43, Matthew Brett matthew.br...@gmail.com wrote:

Re: [Numpy-discussion] Fortran was dead ... [was Re: rewriting NumPy code in C or C++ or similar]

2011-03-16 Thread Ravi
On Monday 14 March 2011 15:02:32 Sebastian Haase wrote: Sturla has been writing so much about Fortran recently, and Ondrej now says he has done the move from C/C++ to Fortran -- I thought Fortran was dead ... !? ;-) What am I missing here ? Comparing Fortran with C++ is like comparing

Re: [Numpy-discussion] Fortran was dead ... [was Re: rewriting NumPy code in C or C++ or similar]

2011-03-16 Thread Dag Sverre Seljebotn
On 03/16/2011 08:10 PM, Ravi wrote: On Monday 14 March 2011 15:02:32 Sebastian Haase wrote: Sturla has been writing so much about Fortran recently, and Ondrej now says he has done the move from C/C++ to Fortran -- I thought Fortran was dead ... !? ;-) What am I missing here ? Comparing

Re: [Numpy-discussion] Fortran was dead ... [was Re:rewriting NumPy code in C or C++ or similar]

2011-03-16 Thread baker . alexander
My two pence worth, my experience is across python, C++ and fortran (and a few other languages) and the posts here are interesting and relevant. I think that the true value of any of these languages is knowing any of them well, if you happen to work with other folks who share the same skills

[Numpy-discussion] Accessing elements of an object array

2011-03-16 Thread lists_ravi
Hi, How do I access elements of an object array? The object array was created by scipy.io.loadmat from a MAT file. Here's an example: In [10]: x Out[10]: array(array((7.399500875785845e-10, 7.721153414752673e-10, -0.984375), dtype=[('cl', '|O8'), ('tl', '|O8'), ('dagc', '|O8')]),

Re: [Numpy-discussion] Accessing elements of an object array

2011-03-16 Thread Robert Kern
On Wed, Mar 16, 2011 at 15:18, lists_r...@lavabit.com wrote: Hi,  How do I access elements of an object array? The object array was created by scipy.io.loadmat from a MAT file. Here's an example: In [10]: x Out[10]: array(array((7.399500875785845e-10, 7.721153414752673e-10, -0.984375),    

Re: [Numpy-discussion] hashing dtypes, new variation, old theme

2011-03-16 Thread Mark Wiebe
On Wed, Mar 16, 2011 at 10:53 AM, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 16, 2011 at 12:15, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Mar 16, 2011 at 10:00 AM, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 16, 2011 at 11:55, Robert Kern robert.k...@gmail.com wrote:

Re: [Numpy-discussion] loadmat output (was Re: Accessing elements of an object array)

2011-03-16 Thread lists_ravi
On Wed, Mar 16, 2011 at 15:18, lists_r...@lavabit.com wrote: In [10]: x Out[10]: array(array((7.399500875785845e-10, 7.721153414752673e-10, -0.984375), Â Â Â dtype=[('cl', '|O8'), ('tl', '|O8'), ('dagc', '|O8')]), dtype=object) In [11]: x.shape, x.size Out[11]: ((), 1) It's not that

Re: [Numpy-discussion] Fortran was dead ... [was Re:rewriting NumPy code in C or C++ or similar]

2011-03-16 Thread william ratcliff
Related to this, what is the status of fwrap? Can it be used with fortran 95/2003 language features? There is a rather large code crystallographic codebase (fullprof) that is written in fortran 77 that the author has been porting to fortran 95/2003 and actually using modules for. I'd like to

Re: [Numpy-discussion] convert dictionary of arrays into single array

2011-03-16 Thread John
Yes, stacking is fine, and looping per John's suggestion is what I've done, I was just wondering if there was possibly a more 'pythonic' or more importantly efficient way than the loop. Thanks, john On Wed, Mar 16, 2011 at 3:38 PM, John Salvatier jsalv...@u.washington.edu wrote: I think he

Re: [Numpy-discussion] loadmat output (was Re: Accessing elements of an object array)

2011-03-16 Thread Matthew Brett
Hi, On Wed, Mar 16, 2011 at 1:56 PM, lists_r...@lavabit.com wrote: On Wed, Mar 16, 2011 at 15:18,  lists_r...@lavabit.com wrote: In [10]: x Out[10]: array(array((7.399500875785845e-10, 7.721153414752673e-10, -0.984375), Â  Â  Â dtype=[('cl', '|O8'), ('tl', '|O8'), ('dagc', '|O8')]),

Re: [Numpy-discussion] *= operator not intuitive

2011-03-16 Thread Christopher Barker
On 3/16/11 9:22 AM, Paul Anton Letnes wrote: This comes up for discussion on a fairly regular basis. I tend towards the more warnings side myself, but you aren't going to get the current behavior changed unless you can convince a large bunch of people that it is the right thing to do,

Re: [Numpy-discussion] Fortran was dead ... [was Re:rewriting NumPy code in C or C++ or similar]

2011-03-16 Thread Dag Sverre Seljebotn
On 03/16/2011 10:14 PM, william ratcliff wrote: Related to this, what is the status of fwrap? Can it be used with fortran 95/2003 language features? There is a rather large code crystallographic codebase (fullprof) that is written in fortran 77 that the author has been porting to fortran

[Numpy-discussion] Build ERROR ConfigParser.MissingSectionHeaderError: File contains no section headers

2011-03-16 Thread Jose Borreguero
Dear Numpy/SciPy users, I have a build error with Numpy: $ /usr/local/bin/python2.7 setup.py build File /usr/local/lib/python2.7/ConfigParser.py, line 504, in _read raise MissingSectionHeaderError(fpname, lineno, line) ConfigParser.MissingSectionHeaderError: File contains no section

Re: [Numpy-discussion] Build ERROR ConfigParser.MissingSectionHeaderError: File contains no section headers

2011-03-16 Thread josef . pktd
On Thu, Mar 17, 2011 at 12:23 AM, Jose Borreguero borregu...@gmail.com wrote: Dear Numpy/SciPy users, I have a build error with Numpy: $  /usr/local/bin/python2.7 setup.py build   File /usr/local/lib/python2.7/ConfigParser.py, line 504, in _read     raise