Re: [Numpy-discussion] Having trouble installing Numpy on OS X
I ended by giving up and grabbing the binary. I'll get 2.5 for Numpy too. I did grab Xcode 2.5, which has gcc 4.0.1. I didn't feel up to manually doing a complete change to the latest gcc, at least while my needs are being met. Thanks, Nat On Jan 24, 2009, at 9:04 PM, Michael Abshoff wrote: Robert Kern wrote: On Sat, Jan 24, 2009 at 18:31, Nat Wilson njwilso...@gmail.com wrote: It throws this out. Python 2.6.1 (r261:67515, Jan 24 2009, 16:08:37) [GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin Type help, copyright, credits or license for more information. import os os.urandom(16) '\xe0;n\x8a*\xb4\x08N\x80\xef\x9b*\x06\x1b\xc4' Well, looking at the C code for random_seed(), I don't see a way for it to return NULL without having an exception set (assuming that the Python API calls aren't buggy). Except maybe the assert() call in there. When you built your Python, are you sure that -DNDEBUG was being used? Well, the gcc used to compiler Python is rather ancient and that gcc release by Apple has the reputation to be buggier than a Florida swamp in July and at least for building Sage it is blacklisted. So I would suggest updating gcc by using some more recent XCode and trying again. Cheers, Michael ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] Having trouble installing Numpy on OS X
Would anyone be willing to help me interpret an error while trying to build and install Numpy? I've searched around, and haven't seen this elsewhere. I've been running into this wall for about half the day now. I've tried reinstalling Python, using numpy 1.2.0 and 1.2.1. I have Python 2.6.1, running on OS X 10.4.11, with a G4 PPC processor. Here's the print out: Ganymede:~/Desktop/numpy-1.2.1 username$ python setup.py build Running from numpy source directory. Traceback (most recent call last): File setup.py, line 96, in module setup_package() File setup.py, line 68, in setup_package from numpy.distutils.core import setup File /Users/username/Desktop/numpy/numpy/distutils/__init__.py, line 6, in module File /Users/username/Desktop/numpy/numpy/distutils/ccompiler.py, line 11, in module File /Users/username/Desktop/numpy/numpy/distutils/log.py, line 7, in module File /Users/username/Desktop/numpy/numpy/distutils/misc_util.py, line 8, in module File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/tempfile.py, line 34, in module from random import Random as _Random File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/random.py, line 871, in module _inst = Random() File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/random.py, line 96, in __init__ self.seed(x) File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/random.py, line 115, in seed super(Random, self).seed(a) SystemError: error return without exception set Any ideas? I've had numpy/scipy installed in the past, but recently had to wipe everything and start from scratch. Everything should be pretty clean right now. Am I missing something obvious? Thanks, NJW ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Having trouble installing Numpy on OS X
I had not, but that doesn't seem to make any difference. By the way, I'm using gfortran 4.2.3 as I do this. Nat On Jan 24, 2009, at 4:38 PM, John Gleeson wrote: On 2009-01-24, at 11:34 AM, Nat Wilson wrote: Would anyone be willing to help me interpret an error while trying to build and install Numpy? I've searched around, and haven't seen this elsewhere. I've been running into this wall for about half the day now. I've tried reinstalling Python, using numpy 1.2.0 and 1.2.1. I have Python 2.6.1, running on OS X 10.4.11, with a G4 PPC processor. Have you tried setting the environment variable MACOSX_DEPLOYMENT_TARGET=10.4 before building? ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Having trouble installing Numpy on OS X
Ah, no, I can't import it. What does this mean? As far as I know, I built Python as instructed. Python 2.6.1 (r261:67515, Jan 24 2009, 16:08:37) [GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin Type help, copyright, credits or license for more information. from random import Random as _Random Traceback (most recent call last): File stdin, line 1, in module File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/random.py, line 871, in module _inst = Random() File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/random.py, line 96, in __init__ self.seed(x) File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/random.py, line 115, in seed super(Random, self).seed(a) SystemError: error return without exception set Nat On Jan 24, 2009, at 6:09 PM, Robert Kern wrote: On Sat, Jan 24, 2009 at 12:34, Nat Wilson njwilso...@gmail.com wrote: Would anyone be willing to help me interpret an error while trying to build and install Numpy? I've searched around, and haven't seen this elsewhere. File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/tempfile.py, line 34, in module from random import Random as _Random File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/random.py, line 871, in module _inst = Random() File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/random.py, line 96, in __init__ self.seed(x) File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/random.py, line 115, in seed super(Random, self).seed(a) SystemError: error return without exception set Any ideas? It looks unrelated to numpy. Can you import the random module in other situations? -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. -- Umberto Eco ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Having trouble installing Numpy on OS X
It throws this out. Python 2.6.1 (r261:67515, Jan 24 2009, 16:08:37) [GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin Type help, copyright, credits or license for more information. import os os.urandom(16) '\xe0;n\x8a*\xb4\x08N\x80\xef\x9b*\x06\x1b\xc4' Nat On Jan 24, 2009, at 7:12 PM, Robert Kern wrote: On Sat, Jan 24, 2009 at 17:58, Nat Wilson njwilso...@gmail.com wrote: Ah, no, I can't import it. What does this mean? As far as I know, I built Python as instructed. I'm not sure. Can you show me what os.urandom(16) gives you? -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. -- Umberto Eco ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Having trouble installing Numpy on OS X
To be honest, I really don't know. I followed the directions in /Mac/ README for a framework install. How would I check this? Thanks a lot for sticking with me, Nat On Jan 24, 2009, at 7:41 PM, Robert Kern wrote: On Sat, Jan 24, 2009 at 18:31, Nat Wilson njwilso...@gmail.com wrote: It throws this out. Python 2.6.1 (r261:67515, Jan 24 2009, 16:08:37) [GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin Type help, copyright, credits or license for more information. import os os.urandom(16) '\xe0;n\x8a*\xb4\x08N\x80\xef\x9b*\x06\x1b\xc4' Well, looking at the C code for random_seed(), I don't see a way for it to return NULL without having an exception set (assuming that the Python API calls aren't buggy). Except maybe the assert() call in there. When you built your Python, are you sure that -DNDEBUG was being used? -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. -- Umberto Eco ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] calling numpy from java
hi all, is it possible to use numpy functions (like eigh()..etc)from java code? isthere a java wrapper for numpy? thanks wilson ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] svd and eigh
I am trying out the eigenvectors related functions in numpy.linalg.I came across some portions where i have doubts. 1). i have an array X if i calculate L=dot(X,X.transpose()) can L be called the covariance matrix of X?I read so in a paper by TurkPentland(equation 3 i think) can someone clarify this ? 2). i tried to find eigenvectors using svd() and eigh() functions evects1,evals,vt=svd(L,0) evals,evects2=eigh(L) and sorted both evects1 and evects2 in the descending order of their evals here i find that evects1 and evects2 have same values but some of the values differ in their signs.why is this? can anyone explain tia W ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] svd and eigh
thanks for the links.. but why the different signs for entries in eigenvectors? is it a library specific thing? shouldn't they be identical? W ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] sort
i have a 1 dimensional array of floats that i want to sort in descending order.i did as follows from numpy import tolist,array,sort y=array([..]) #may be 1000 items z=sort(y) l=z.tolist() l.reverse() rl=array(l) now rl is a 1 dim array sorted in descending order. but i am looking for a better,compact way to do this.can someone help? ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] diagonalising a 2d array
hi what exactly does diagonalising a matrix mean? how do you do it on a symmetric numpy array? W ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] meaning of accumulation/normalisation
hi i came across some image processing code in java and tried to duplicate the operation on an ndarray.the array is supposed to contain pixel values of a gryscale image generated by the program. however the code does some accumulation operation as below to obtain a value 'norm' ul=array(([],[],[...])) #containing float values def accumOperation(ul): nr,nc=ul.shape print nr:,nr,nc:,nc val=0.0 for r in range(nr): for c in range(nc): val+=ul[r][c]*ul[r][c] return val norm=accumOperation(ul) newul=ul/norm the java doc mentions that by the above steps ul is normalised to unit length (vector length) can someone explain this?it is not very clear to me and (i am trying to understand the code by reading and tying out in debugger.. the newul array content is then used to generate a pgm image in the code) thanks W ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] multiply array
hello i have two arrays #of shape (1,6) eval=array([[3.,3.2,1.,1.1,5.,0.5]]) #of shape (6,8) egimgs=array([ [3.,2.,1.,4.,5.,1.5,2.5,1.1], [1.1,3.,.5,.2,.1,4.3,3.2,1.2], [4.,3.,2.,6.,1.,4.,5.1,2.4], [3.2,1.3,2.2,4.4,1.1,2.1,3.3,2.4], [.4,.2,.1,.5,.3,.2,1.2,4.2], [5.2,2.1,4.3,5.5,2.2,1.1,1.4,3.2] ] ) i need to multiply the first row of egimgs with the first element of eval , second row of egimgs with second element of eval ..etc ...and so on..finally i should get a result array of same shape as egimgs. how should i proceed ? using loops seems inefficient.can someone suggest a better way? thanks W ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] multiply array
#of shape (1,6) eval=array([[3.,3.2,1.,1.1,5.,0.5]]) eval.shape=(-1,) please not the correction..i need to multiply first row of egimgs with 3.0 ,second row with 3.2,last(sixth) row with 0.5 ..For that purpose i made the above into a 1 dimensional array. A for loop seems inefficient in the case of big arrays W ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion