Re: [Numpy-discussion] SVD does not converge on clean matrix

2011-08-14 Thread Charanpal Dhanjal
I had a quick look at the code (https://github.com/numpy/numpy/blob/master/numpy/linalg/linalg.py) and the numpy.linalg.svd function calls lapack_lite.dgesdd (for real matrices) so I guess the non-convergence occurs in this function. As I understood lapack_lite is used by default unless numpy

Re: [Numpy-discussion] SVD does not converge on clean matrix

2011-08-14 Thread Lou Pecora
Chuck wrote: Fails here also, fedora 15 64 bits AMD 940. There should be a maximum iterations argument somewhere... Chuck ---    ***  Here's the FIX: Chuck is right.  There is a max iterations.  Here is a

Re: [Numpy-discussion] Efficient way to load a 1Gb file?

2011-08-14 Thread Torgil Svensson
Try the fromiter function, that will allow you to pass an iterator which can read the file line by line and not preload the whole file. file_iterator = iter(open('filename.txt') line_parser = lambda x: map(float,x.split('\t')) a=np.fromiter(itertools.imap(line_parser,file_iterator),dtype=float)

Re: [Numpy-discussion] Questionable reduceat behavior

2011-08-14 Thread Wes McKinney
On Sat, Aug 13, 2011 at 8:06 PM, Mark Wiebe mwwi...@gmail.com wrote: Looks like this is the second-oldest open bug in the bug tracker. http://projects.scipy.org/numpy/ticket/236 For what it's worth, I'm in favour of changing this behavior to be more consistent as proposed in that ticket.

[Numpy-discussion] help translating matlab to numpy

2011-08-14 Thread alan
I'm translating some code from Matlab to numpy, and struggling a bit since I have very little knowledge of Matlab. My question is this - the arg function in Matlab (which seems to be deprecated, they don't show it in their current documentation) is exactly equivalent to what in Numpy? I know it

Re: [Numpy-discussion] help translating matlab to numpy

2011-08-14 Thread Fabrice Silva
Le dimanche 14 août 2011 à 12:43 -0500, a...@ajackson.org a écrit : I'm translating some code from Matlab to numpy, and struggling a bit since I have very little knowledge of Matlab. My question is this - the arg function in Matlab (which seems to be deprecated, they don't show it in their

Re: [Numpy-discussion] help translating matlab to numpy

2011-08-14 Thread alan
Never mind, I've been digging through too much stuff and got confused... I think trying to read Matlab code can do that to you. 8-) I'm translating some code from Matlab to numpy, and struggling a bit since I have very little knowledge of Matlab. My question is this - the arg function in Matlab

Re: [Numpy-discussion] SVD does not converge on clean matrix

2011-08-14 Thread Charanpal Dhanjal
Thanks very much Lou for the information. I tried delving into the C code and found a line in the dlasd4_ routine which reads: for (niter = iter; niter = MAXITERLOOPS; ++niter) { This is apparently the main loop for this subroutine and the value of MAXITERLOOPS = 100. All I did was increase

Re: [Numpy-discussion] Statistical distributions on samples

2011-08-14 Thread Brennan Williams
You can use scipy.stats.truncnorm, can't you? Unless I misread, you want to sample a normal distribution but with generated values only being within a specified range? However you also say you want to do this with triangular and log normal and for these I presume the easiest way is to sample

[Numpy-discussion] __array_wrap__ / __array_finalize__ in NumPy v1.4+

2011-08-14 Thread Aronne Merrelli
Hello, I'm attempting to implement a subclass of ndarray, and becoming confused about the way __array_wrap__ and __array_finalize__ operate. I boiled it down to a short subclass, which is the example on the website at http://docs.scipy.org/doc/numpy-1.6.0/user/basics.subclassing.html, with one