Re: [Numpy-discussion] How can I constrain linear_least_squares to integer solutions?

2007-11-28 Thread Stefan van der Walt
On Tue, Nov 27, 2007 at 11:07:30PM -0700, Charles R Harris wrote: This is not a trivial problem, as you can see by googling mixed integer least squares (MILS). Much will depend on the nature of the parameters, the number of variables you are using in the fit, and how exact the solution needs

Re: [Numpy-discussion] Appending a numpy array to existing text file

2007-11-28 Thread Andy Cheesman
It does indeed work Thanks for the help Andy LB wrote: If you just want to add your matrix to an existing ascii file, you can open this file in append mode and give the file handle to numpy.savetxt : f_handle = file('my_file.dat', 'a') savetxt(f_handle, my_matrix) f_handle.close() HTH

[Numpy-discussion] documentation generator based on pyparsing

2007-11-28 Thread Robert Cimrman
Hi, At http://scipy.org/Generate_Documentation you can find a very small documentation generator for NumPy/SciPy modules based on pyparsing package (by Paul McGuire). I am not sure if this belongs to where I put it, so feel free to (re)move the page as needed. I hope it might be interesting

Re: [Numpy-discussion] How can I constrain linear_least_squares to integer solutions?

2007-11-28 Thread Timothy Hochberg
On Nov 28, 2007 12:59 AM, Stefan van der Walt [EMAIL PROTECTED] wrote: On Tue, Nov 27, 2007 at 11:07:30PM -0700, Charles R Harris wrote: This is not a trivial problem, as you can see by googling mixed integer least squares (MILS). Much will depend on the nature of the parameters, the

[Numpy-discussion] Converting char array to float

2007-11-28 Thread Sameer DCosta
I'm trying to convert a character array to a floating point array. I'm using one of the recent svn builds. It is surprising that astype does not do the job. However if I first convert the char array to an array and then use astype everything works fine. Is this a bug? import numpy as N print

Re: [Numpy-discussion] Converting char array to float

2007-11-28 Thread Pierre GM
Sameer, I can't tell whether it's a bug or a feature, but I can give you some explanation: when you call .astype on your chararray, you call the __array_finalize__ of the chararray, which requires the dtype to be string like. Obviously, that won't work in your case. Transforming the chararray

Re: [Numpy-discussion] Converting char array to float

2007-11-28 Thread Matthieu Brucher
a does not seem to be an array, so it is not surprising that you need to convert it to an array first. Matthieu 2007/11/28, Sameer DCosta [EMAIL PROTECTED]: I'm trying to convert a character array to a floating point array. I'm using one of the recent svn builds. It is surprising that astype

Re: [Numpy-discussion] Converting char array to float

2007-11-28 Thread Pierre GM
On Wednesday 28 November 2007 13:39:45 Matthieu Brucher wrote: a does not seem to be an array, so it is not surprising that you need to convert it to an array first. Well, a *IS* a regular chararray, and therefore a subclass of ndarray (try isinstance). The problem isn't here, it's that the

Re: [Numpy-discussion] documentation generator based on pyparsing

2007-11-28 Thread Nils Wagner
On Wed, 28 Nov 2007 11:29:20 +0100 Robert Cimrman [EMAIL PROTECTED] wrote: Hi, At http://scipy.org/Generate_Documentation you can find a very small documentation generator for NumPy/SciPy modules based on pyparsing package (by Paul McGuire). I am not sure if this belongs to where I

Re: [Numpy-discussion] Converting char array to float

2007-11-28 Thread Travis E. Oliphant
Sameer DCosta wrote: I'm trying to convert a character array to a floating point array. I'm using one of the recent svn builds. It is surprising that astype does not do the job. However if I first convert the char array to an array and then use astype everything works fine. Is this a bug?

Re: [Numpy-discussion] How can I constrain linear_least_squares to integer solutions?

2007-11-28 Thread Charles R Harris
On Nov 28, 2007 12:59 AM, Stefan van der Walt [EMAIL PROTECTED] wrote: On Tue, Nov 27, 2007 at 11:07:30PM -0700, Charles R Harris wrote: This is not a trivial problem, as you can see by googling mixed integer least squares (MILS). Much will depend on the nature of the parameters, the

[Numpy-discussion] Building NumPy on Mac OS X without Apple GCC

2007-11-28 Thread Joshua Lippai
I updated my GCC to a more recent version a day ago, since Apple's Xcode Tools only provide GCC 4.0 and the current release of GNU's GCC is 4.2. I successfully achieved this, but now I run into a problem when trying to build NumPy: gcc: unrecognized option '-no-cpp-precomp' cc1: error:

Re: [Numpy-discussion] Building NumPy on Mac OS X without Apple GCC

2007-11-28 Thread Robert Kern
Joshua Lippai wrote: I updated my GCC to a more recent version a day ago, since Apple's Xcode Tools only provide GCC 4.0 and the current release of GNU's GCC is 4.2. I successfully achieved this, but now I run into a problem when trying to build NumPy: gcc: unrecognized option

Re: [Numpy-discussion] Building NumPy on Mac OS X without Apple GCC

2007-11-28 Thread Robert Kern
Joshua Lippai wrote: Thanks for the reply. Well, I built my Python stuff, including NumPy previously, before I changed to the higher GCC version. Do you know if there's an option I can toggle that will specify Apple's GCC to be used? $ CC=/usr/bin/gcc python setup.py build -- Robert Kern

Re: [Numpy-discussion] Building NumPy on Mac OS X without Apple GCC

2007-11-28 Thread Joshua Lippai
Joshua Lippai wrote: I updated my GCC to a more recent version a day ago, since Apple's Xcode Tools only provide GCC 4.0 and the current release of GNU's GCC is 4.2. I successfully achieved this, but now I run into a problem when trying to build NumPy: gcc: unrecognized option