Re: [Numpy-discussion] Crash on (un-orthodox) __import__

2011-10-06 Thread Han Genuit
> Still, it shouldn't segfault, and it's worth figuring out why it does. > gdb has been mostly unenlightening for me since gdb won't let me > navigate the traceback. You could try faulthandler, it prints the (python) traceback after a crash: http://pypi.python.org/pypi/faulthandler/ __

Re: [Numpy-discussion] Crash on (un-orthodox) __import__

2011-10-06 Thread Robert Kern
On Thu, Oct 6, 2011 at 17:25, Paul Ivanov wrote: > Hi Andrea, > > On Tue, Oct 4, 2011 at 3:04 AM, Andrea Gavana wrote: >> Hi All, >>     I was fiddling here and there with some code doing dynamic import of >> stuff, and I noticed that this code: >> import os >> import sys >> init_name = r"C:\Pyth

Re: [Numpy-discussion] Crash on (un-orthodox) __import__

2011-10-06 Thread Paul Ivanov
Hi Andrea, On Tue, Oct 4, 2011 at 3:04 AM, Andrea Gavana wrote: > Hi All, >     I was fiddling here and there with some code doing dynamic import of > stuff, and I noticed that this code: > import os > import sys > init_name = r"C:\Python27\Lib\site-packages\numpy\__init__.py" > directory, module

Re: [Numpy-discussion] nditer: possible to manually handle dimensions with different lengths?

2011-10-06 Thread John Salvatier
I ended up fixing my problem by removing the 'buffering' flag and adding the 'copy' flag to each of the input arrays. I think that nested_iters might be improved by an operand axes specification for each layer of nesting like nditer uses, though I suppose that 3 layers of nesting might be confusin

Re: [Numpy-discussion] build errors

2011-10-06 Thread Paul Anton Letnes
You can use the BLAS and LAPACK environment variables. export BLAS=/path/to/libatlas.so export LAPACK=/path/to/libatlas.so python setup.py build I've recently had problems with ATLAS solving equation systems incorrectly for certain inputs with no adequate explanation. Re-running the same simu

Re: [Numpy-discussion] build errors

2011-10-06 Thread Miah Wadud Dr (ITCS)
Hi again, I have built the ATLAS dynamic shared libraries and now need to tell numpy to build against them which are located in a different location to where it expects them. Do you know how I can do that? The command I am using to build numpy is: python setup.py build --fcompiler=gnu95 but

Re: [Numpy-discussion] simple vector->matrix question

2011-10-06 Thread Warren Weckesser
On Thu, Oct 6, 2011 at 7:29 AM, Samuel John wrote: > I just learned two things: > > 1. np.newaxis > 2. Array dimension broadcasting rocks more than you think. > > Yup. :) > > The x[:, np.newaxis] might not be the most intuitive solution but it's > great and powerful. > Intuitive would be to h

Re: [Numpy-discussion] simple vector->matrix question

2011-10-06 Thread Samuel John
I just learned two things: 1. np.newaxis 2. Array dimension broadcasting rocks more than you think. The x[:, np.newaxis] might not be the most intuitive solution but it's great and powerful. Intuitive would be to have x.T to transform [0,1,2,4] into [[0],[1],[2],[4]]. Thanks Warren :-) Samuel

Re: [Numpy-discussion] simple vector->matrix question

2011-10-06 Thread Samuel John
import numpy # Say y is y = numpy.array([1,2,3]) Y = numpy.vstack([y,y,y,y]) # Y is array([[1, 2, 3], # [1, 2, 3], # [1, 2, 3], # [1, 2, 3]]) x = numpy.array([[0],[2],[4],[6]]) # a column-vector of your scalars x0, x1... Y - x Hope this is what you meant. cheers, Sa

Re: [Numpy-discussion] simple vector->matrix question

2011-10-06 Thread Warren Weckesser
On Thu, Oct 6, 2011 at 7:08 AM, Neal Becker wrote: > Given a vector y, I want a matrix H whose rows are > > y - x0 > y - x1 > y - x2 > ... > > > where x_i are scalars > > Suggestion? > > In [15]: import numpy as np In [16]: y = np.array([10.0, 20.0, 30.0]) In [17]: x = np.array([0, 1, 2, 4])

[Numpy-discussion] simple vector->matrix question

2011-10-06 Thread Neal Becker
Given a vector y, I want a matrix H whose rows are y - x0 y - x1 y - x2 ... where x_i are scalars Suggestion? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] build errors

2011-10-06 Thread Miah Wadud Dr (ITCS)
Hi David, Thanks for your reply. Nope, I didn't build the ATLAS libraries myself and am trying to do that now. However, whenever I try to build the shared libraries using the configure command: [root@cn130 linux]# ../configure -Fa alg -fPIC --prefix=/gpfs/grace/atlas-3.8.4 it keeps building th