[Numpy-discussion] einsum slow vs (tensor)dot

2012-10-24 Thread George Nurser
Hi, I was just looking at the einsum function. To me, it's a really elegant and clear way of doing array operations, which is the core of what numpy is about. It removes the need to remember a range of functions, some of which I find tricky (e.g. tile). Unfortunately the present implementation

[Numpy-discussion] np.linalg.lstsq with several columns all 0 = huge x ?

2012-10-24 Thread denis
Folks, np.linalg.lstsq of a random-uniform A 50 x 32 with 3 columns all 0 returns x[:3] 0 as expected, but 4 columns all 0 = huge x: lstsq (50, 32) with 4 columns all 0: [ -3.7e+09 -3.6e+13 -1.9e+13 -2.9e+12 7.3e-01 ... This may be a roundoff problem, or even a Mac Altivec lapack bug,

Re: [Numpy-discussion] np.linalg.lstsq with several columns all 0 = huge x ?

2012-10-24 Thread josef . pktd
On Wed, Oct 24, 2012 at 1:33 PM, denis denis-bz...@t-online.de wrote: Folks, np.linalg.lstsq of a random-uniform A 50 x 32 with 3 columns all 0 returns x[:3] 0 as expected, but 4 columns all 0 = huge x: lstsq (50, 32) with 4 columns all 0: [ -3.7e+09 -3.6e+13 -1.9e+13 -2.9e+12

[Numpy-discussion] how to pipe into numpy arrays?

2012-10-24 Thread Michael Aye
As numpy.fromfile seems to require full file object functionalities like seek, I can not use it with the sys.stdin pipe. So how could I stream a binary pipe directly into numpy? I can imagine storing the data in a string and use StringIO but the files are 3.6 GB large, just the binary, and that

Re: [Numpy-discussion] how to pipe into numpy arrays?

2012-10-24 Thread Benjamin Root
On Wed, Oct 24, 2012 at 3:00 PM, Michael Aye kmichael@gmail.com wrote: As numpy.fromfile seems to require full file object functionalities like seek, I can not use it with the sys.stdin pipe. So how could I stream a binary pipe directly into numpy? I can imagine storing the data in a

Re: [Numpy-discussion] Is there a way to reset an accumulate function?

2012-10-24 Thread Cera, Tim
On Wed, Oct 24, 2012 at 4:47 AM, Robert Kern robert.k...@gmail.com wrote: How about this? def nancumsum(x): nans = np.isnan(x) x = np.array(x) x[nans] = 0 reset_idx = np.zeros(len(x), dtype=int) reset_idx[nans] = np.arange(len(x))[nans] reset_idx =

[Numpy-discussion] error of install numpy on linux redhat.

2012-10-24 Thread Jack Bryan
Hi, All, I am trying to install numpy from http://www.scipy.org/Download . by git clone git://github.com/numpy/numpy.git numpy But, when I ran python setup.py install I got: SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel Where to get python-dev ?