Re: [Numpy-discussion] idea of optimisation?

2011-12-06 Thread David Froger
Excerpts from Xavier Barthelemy's message of mar. déc. 06 08:51:22 +0100 2011: ok let me be more precise I have an Z array which is the elevation from this I extract a discrete array of Zero Crossing, and another discrete array of Crests. len(crest) is different than len(Xzeros). I have a

Re: [Numpy-discussion] What does fftn take as parameters?

2011-12-06 Thread Pauli Virtanen
06.12.2011 08:49, Roger Binns kirjoitti: Note that I am using regular Python lists (they were JSON at one point) and the fft documentation is incomprehensible to someone who hasn't used numpy before and only cares about fft (there are a lot of matches for Google searches about fft and python

Re: [Numpy-discussion] idea of optimisation?

2011-12-06 Thread Xavier Barthelemy
Yes I understood what you said. I know these tools, and I am using them. I was just wandering if someone has a more one-liner-pythonic way to do it. I don't think it's worth importing a new fortran module. Thanks anyway :) Xavier 2011/12/6 David Froger david.fro...@gmail.com Excerpts from

[Numpy-discussion] adding unsigned int and int

2011-12-06 Thread Skipper Seabold
Hi, Is this intended? [~/] [1]: np.result_type(np.uint, np.int) [1]: dtype('float64') [~/] [2]: np.version.version [2]: '2.0.0.dev-aded70c' Skipper ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] adding unsigned int and int

2011-12-06 Thread Matthew Brett
Hi, On Tue, Dec 6, 2011 at 4:45 AM, Skipper Seabold jsseab...@gmail.com wrote: Hi, Is this intended? [~/] [1]: np.result_type(np.uint, np.int) [1]: dtype('float64') I would guess so - if your system ints are 64 bit. int64 can't contain the range for uint64, nor can uint64 contain all

Re: [Numpy-discussion] adding unsigned int and int

2011-12-06 Thread Skipper Seabold
On Tue, Dec 6, 2011 at 7:53 AM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Tue, Dec 6, 2011 at 4:45 AM, Skipper Seabold jsseab...@gmail.com wrote: Hi, Is this intended? [~/] [1]: np.result_type(np.uint, np.int) [1]: dtype('float64') I would guess so - if your system ints are

Re: [Numpy-discussion] What does fftn take as parameters?

2011-12-06 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/12/11 01:58, Pauli Virtanen wrote: I think this cannot be helped --- it does not make sense to explain basic Numpy concepts in every docstring, especially `axis` and `shape` are very common. They don't need to be explained on the page, but

Re: [Numpy-discussion] idea of optimisation?

2011-12-06 Thread Tony Yu
On Tue, Dec 6, 2011 at 2:51 AM, Xavier Barthelemy xab...@gmail.com wrote: ok let me be more precise I have an Z array which is the elevation from this I extract a discrete array of Zero Crossing, and another discrete array of Crests. len(crest) is different than len(Xzeros). I have a

[Numpy-discussion] howto store 2D function values and their grid points

2011-12-06 Thread K . -Michael Aye
Dear all, I can't wrap my head around this. Mathematically it's not hard, I just don't know how to store and access it without many loops. I have a function f(x,y). I would like to calculate it at x = arange(20,101,20) and y = arange(2,30,2) How do I store that in a multi-dimensional array

Re: [Numpy-discussion] What does fftn take as parameters?

2011-12-06 Thread Chris Barker
On 12/6/2011 8:32 AM, Roger Binns wrote: I think this cannot be helped --- it does not make sense to explain basic Numpy concepts in every docstring, especially `axis` and `shape` are very common. They don't need to be explained on the page, but instead link to a page that does explain them.

Re: [Numpy-discussion] howto store 2D function values and their grid points

2011-12-06 Thread Chris Barker
On 12/6/2011 9:54 AM, K.-Michael Aye wrote: I have a function f(x,y). I would like to calculate it at x = arange(20,101,20) and y = arange(2,30,2) How do I store that in a multi-dimensional array and preserve the grid points where I did the calculation In [5]: X, Y = np.meshgrid(range(3),

Re: [Numpy-discussion] NumPy Governance

2011-12-06 Thread Jonathan T. Niehof
Travis Oliphant wrote: My initial thoughts: I don't have a horse in this race, but I do suggest people read Karl Fogel's book before too much designing of governance structure: http://producingoss.com/ (alas, it's not short, but it's a fairly easy read and you can get convenient dead-tree or

Re: [Numpy-discussion] What does fftn take as parameters?

2011-12-06 Thread Paul Anton Letnes
On 6. des. 2011, at 17:32, Roger Binns wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/12/11 01:58, Pauli Virtanen wrote: I think this cannot be helped --- it does not make sense to explain basic Numpy concepts in every docstring, especially `axis` and `shape` are very

Re: [Numpy-discussion] What does fftn take as parameters?

2011-12-06 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/12/11 10:45, Paul Anton Letnes wrote: As a side note: since the built-in search isn't really all that good, would it be possible to put a customized google search box there instead? It is easy since Sphinx is being used. Copy searchbox.html

Re: [Numpy-discussion] numpy 1.7.0 release?

2011-12-06 Thread Ralf Gommers
On Mon, Dec 5, 2011 at 8:43 PM, Ralf Gommers ralf.gomm...@googlemail.comwrote: Hi all, It's been a little over 6 months since the release of 1.6.0 and the NA debate has quieted down, so I'd like to ask your opinion on the timing of 1.7.0. It looks to me like we have a healthy amount of bug

Re: [Numpy-discussion] numpy 1.7.0 release?

2011-12-06 Thread Wes McKinney
On Tue, Dec 6, 2011 at 4:11 PM, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Mon, Dec 5, 2011 at 8:43 PM, Ralf Gommers ralf.gomm...@googlemail.com wrote: Hi all, It's been a little over 6 months since the release of 1.6.0 and the NA debate has quieted down, so I'd like to ask your

[Numpy-discussion] Slow Numpy/MKL vs Matlab/MKL

2011-12-06 Thread Oleg Mikulya
Hi, How to make Numpy to match Matlab in term of performance ? I have tryied with different options, using different MKL libraries and ICC versions, still Numpy is below Matalb for certain basic tasks by ~2x. About 5 years ago I was able to get about same speed, not anymore. Matlab suppose to use

Re: [Numpy-discussion] numpy 1.7.0 release?

2011-12-06 Thread Derek Homeier
On 06.12.2011, at 11:13PM, Wes McKinney wrote: This isn't the place for this discussion but we should start talking about building a *high performance* flat file loading solution with good column type inference and sensible defaults, etc. It's clear that loadtable is aiming for highest

[Numpy-discussion] loop through values in a array and find maximum as looping

2011-12-06 Thread questions anon
I would like to produce an array with the maximum values out of many (1s) of arrays. I need to loop through many multidimentional arrays and if a value is larger (in the same place as the previous array) then I would like that value to replace it. e.g. a=[1,1,2,2 11,2,2 1,1,2,2] b=[1,1,3,2

Re: [Numpy-discussion] loop through values in a array and find maximum as looping

2011-12-06 Thread Olivier Delalleau
It may not be the most efficient way to do this, but you can do: mask = b a a[mask] = b[mask] -=- Olivier 2011/12/6 questions anon questions.a...@gmail.com I would like to produce an array with the maximum values out of many (1s) of arrays. I need to loop through many multidimentional

Re: [Numpy-discussion] loop through values in a array and find maximum as looping

2011-12-06 Thread josef . pktd
On Tue, Dec 6, 2011 at 7:55 PM, Olivier Delalleau sh...@keba.be wrote: It may not be the most efficient way to do this, but you can do: mask = b a a[mask] = b[mask] -=- Olivier 2011/12/6 questions anon questions.a...@gmail.com I would like to produce an array with the maximum values out

Re: [Numpy-discussion] numpy 1.7.0 release?

2011-12-06 Thread Charles R Harris
On Mon, Dec 5, 2011 at 12:43 PM, Ralf Gommers ralf.gomm...@googlemail.comwrote: Hi all, It's been a little over 6 months since the release of 1.6.0 and the NA debate has quieted down, so I'd like to ask your opinion on the timing of 1.7.0. It looks to me like we have a healthy amount of bug

Re: [Numpy-discussion] loop through values in a array and find maximum as looping

2011-12-06 Thread questions anon
Hi Olivier, No that does not seem to do anything am I missing another step whereever b is greater than a replace b with a? thanks On Wed, Dec 7, 2011 at 11:55 AM, Olivier Delalleau sh...@keba.be wrote: It may not be the most efficient way to do this, but you can do: mask = b a a[mask] =

Re: [Numpy-discussion] loop through values in a array and find maximum as looping

2011-12-06 Thread questions anon
thanks for responding Josef but that is not really what I am looking for, I have a multidimensional array and if the next array has any values greater than what is in my first array I want to replace them. The data are contained in netcdf files. I can achieve what I want if I combine all of my

Re: [Numpy-discussion] loop through values in a array and find maximum as looping

2011-12-06 Thread Olivier Delalleau
Weird, it worked for me (with a and b two 1d numpy arrays). Anyway, Josef's solution is probably much more efficient (especially if you can put all your arrays into a single tensor). -=- Olivier 2011/12/6 questions anon questions.a...@gmail.com Hi Olivier, No that does not seem to do anything

Re: [Numpy-discussion] loop through values in a array and find maximum as looping

2011-12-06 Thread Olivier Delalleau
If you need to do them one after the other, numpy.maximum(a, b) will do it (it won't work in-place on 'a' though, it'll make a new copy). -=- Olivier 2011/12/6 questions anon questions.a...@gmail.com thanks for responding Josef but that is not really what I am looking for, I have a

Re: [Numpy-discussion] loop through values in a array and find maximum as looping

2011-12-06 Thread Nathaniel Smith
I think you want np.maximum(a, b, out=a) - Nathaniel On Dec 6, 2011 9:04 PM, questions anon questions.a...@gmail.com wrote: thanks for responding Josef but that is not really what I am looking for, I have a multidimensional array and if the next array has any values greater than what is in

Re: [Numpy-discussion] loop through values in a array and find maximum as looping

2011-12-06 Thread Olivier Delalleau
Thanks, I didn't know you could specify the out array :) (to the OP: my initial suggestion, although probably not very efficient, seems to work with 2D arrays too, so I have no idea why it didn't work for you -- but Nathaniel's one seems to be the ideal one anyway). -=- Olivier 2011/12/6

Re: [Numpy-discussion] loop through values in a array and find maximum as looping

2011-12-06 Thread questions anon
thanks for all of your help, that does look appropriate but I am not sure how to loop it over thousands of files. I need to keep the first array to compare with but replace any greater values as I loop through each array comparing back to the same array. does that make sense? On Wed, Dec 7, 2011

Re: [Numpy-discussion] loop through values in a array and find maximum as looping

2011-12-06 Thread Olivier Delalleau
The out=a keyword will ensure your first array will keep being updated. So you can do something like: a = my_list_of_arrays[0] for b in my_list_of_arrays[1:]: numpy.maximum(a, b, out=a) -=- Olivier 2011/12/6 questions anon questions.a...@gmail.com thanks for all of your help, that does look

Re: [Numpy-discussion] loop through values in a array and find maximum as looping

2011-12-06 Thread josef . pktd
On Tue, Dec 6, 2011 at 9:36 PM, Olivier Delalleau sh...@keba.be wrote: The out=a keyword will ensure your first array will keep being updated. So you can do something like: a = my_list_of_arrays[0] for b in my_list_of_arrays[1:]:   numpy.maximum(a, b, out=a) I didn't think of the out

Re: [Numpy-discussion] loop through values in a array and find maximum as looping

2011-12-06 Thread Olivier Delalleau
Is 'a' a regular numpy array or something fancier? -=- Olivier 2011/12/6 questions anon questions.a...@gmail.com thanks again my only problem though is that the out=a in the loop does not seem to replace my a= outside the loop so my final a is whatever I started with for a. Not sure what I

Re: [Numpy-discussion] loop through values in a array and find maximum as looping

2011-12-06 Thread Olivier Delalleau
I *think* it may work better if you replace the last 3 lines in your loop by: a=all_TSFC[0] if len(all_TSFC) 1: N.maximum(a, TSFC, out=a) Not 100% sure that would work though, as I'm not entirely confident I understand your code. -=- Olivier 2011/12/6

Re: [Numpy-discussion] loop through values in a array and find maximum as looping

2011-12-06 Thread Derek Homeier
On 07.12.2011, at 5:07AM, Olivier Delalleau wrote: I *think* it may work better if you replace the last 3 lines in your loop by: a=all_TSFC[0] if len(all_TSFC) 1: N.maximum(a, TSFC, out=a) Not 100% sure that would work though, as I'm not entirely

Re: [Numpy-discussion] loop through values in a array and find maximum as looping

2011-12-06 Thread Tim Burgess
On 07/12/2011, at 1:49 PM, questions anon wrote: fillvalue=ncfile.variables['T_SFC']._FillValue TSFC=MA.masked_values(TSFC, fillvalue) You can probably also eliminate the above two lines from your code. TSFC=ncfile.variables['T_SFC'][:] If your NetCDF

Re: [Numpy-discussion] loop through values in a array and find maximum as looping

2011-12-06 Thread questions anon
sorry the 'all_TSFC' is for my other check of maximum using concatenate and N.max, I know that works so I am comparing it to this method. The only reason I need another method is for memory error issues. I like the code I have written so far as it makes sense to me. I can't get the extra examples

Re: [Numpy-discussion] loop through values in a array and find maximum as looping

2011-12-06 Thread Derek Homeier
On 07.12.2011, at 5:54AM, questions anon wrote: sorry the 'all_TSFC' is for my other check of maximum using concatenate and N.max, I know that works so I am comparing it to this method. The only reason I need another method is for memory error issues. I like the code I have written so far

Re: [Numpy-discussion] loop through values in a array and find maximum as looping

2011-12-06 Thread questions anon
thanks for all your responses. I think I have FINALLY worked it out with all of your help. I just assigned one array from one ncfile to a at the beginning of my code and then ran the loop and it worked!! sorry for all the questions but I learn so much playing and getting ideas from others. Thanks

Re: [Numpy-discussion] Apparently non-deterministic behaviour of complex array multiplication

2011-12-06 Thread kneil
Hi Nathaniel, The results of running memtest was a pass with no errors. -Karl Nathaniel Smith wrote: (You should still run memtest. It's very easy - just install it with your package manager, then reboot. Hold down the shift key while booting, and you'll get a boot menu. Choose memtest,