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

2007-11-27 Thread Charles R Harris
On Nov 27, 2007 9:51 PM, Mark Schmucker <[EMAIL PROTECTED]> wrote: > Hi, > > > > I have successfully used LinearAlgebra.linear_least_squares to estimate > solutions to continuous functions. The coefficients returned in that case > are of course floating-point values. > > > > Now I have a problem

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

2007-11-27 Thread Mark Schmucker
Hi, I have successfully used LinearAlgebra.linear_least_squares to estimate solutions to continuous functions. The coefficients returned in that case are of course floating-point values. Now I have a problem where some of the terms are continuous but some must be constrained to integer mult

Re: [Numpy-discussion] how do I speed up this?

2007-11-27 Thread Timothy Hochberg
On Nov 27, 2007 12:41 PM, Giorgio F. Gilestro <[EMAIL PROTECTED]> wrote: > Thanks Tim, > shape of the array is variable but follows the rule (x, y*1440) with > both x an y being values greater than 1 (usually around 10 or 20). OK. That's helpful. > So as result second dimension is always much

Re: [Numpy-discussion] How to remove loops over inner()

2007-11-27 Thread Timothy Hochberg
On Nov 26, 2007 2:30 PM, Hans-Andreas Engel <[EMAIL PROTECTED]> wrote: > Dear all: > > After using numpy for several weeks, I am very happy about it and > deeply impressed about the performance improvements it brings in my > python code. Now I have stumbled upon a problem, where I cannot use > nu

Re: [Numpy-discussion] how do I speed up this?

2007-11-27 Thread Giorgio F. Gilestro
Thanks Tim, shape of the array is variable but follows the rule (x, y*1440) with both x an y being values greater than 1 (usually around 10 or 20). So as result second dimension is always much bigger. (and the bug you foresaw is actually taken care of) I figured out that somehow removing the unne

Re: [Numpy-discussion] how do I speed up this?

2007-11-27 Thread Timothy Hochberg
On Nov 27, 2007 11:38 AM, Giorgio F. Gilestro <[EMAIL PROTECTED]> wrote: > Hello everyone, > > ma and new_ma are bi-dimensional array with shape (a1, a2) on which I am > performing the following iteration: > > for fd in range(a1): > new_ma[fd] = [( ma[fd][i-5:i+5].sum() == 0 )*1 for i in range

[Numpy-discussion] how do I speed up this?

2007-11-27 Thread Giorgio F. Gilestro
Hello everyone, ma and new_ma are bi-dimensional array with shape (a1, a2) on which I am performing the following iteration: for fd in range(a1): new_ma[fd] = [( ma[fd][i-5:i+5].sum() == 0 )*1 for i in range (a2)] Is there any faster more elegant way to do that with numpy? Thanks a lot! G

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

2007-11-27 Thread LB
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 -- LB ___ Numpy-discu

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

2007-11-27 Thread Andy Cheesman
Hi people, Just a quick question, how do I append a numpy array to an existing ascii output file? I've looked at the numpy.savetxt function and it performs all the formating functions I desire for my output file but it doesn't let me specify how I save my array type Is there a clever work aroun

[Numpy-discussion] ANN: PyTables & PyTables Pro 2.0.2 are out!

2007-11-27 Thread Ivan Vilata i Balaguer
Hi everyone, We at Carabos are happy to announce the simultaneous release of the new 2.0.2 versions of both PyTables and PyTables Pro. They are mainly bugfix releases, and users of previous versions are encouraged to upgrade. And now the official announce: ==