Re: [Numpy-discussion] ndarray.count() ?

2006-09-07 Thread Robert Kern
rex wrote: > Robert Kern <[EMAIL PROTECTED]> [2006-09-07 16:35]: >> rex wrote: >>> Charles R Harris <[EMAIL PROTECTED]> [2006-09-07 15:04]: I don't know about count, but you can gin up something like this In [78]: a = ran.randint(0,2, size=(10,)) In [79]: a Out[79]: ar

[Numpy-discussion] Fwd: f2py with xmingw

2006-09-07 Thread Flavio Coelho
Hi,I have a module that uses a Fortran extension which I would like to compile for windows with f2py. I wonder If I could do this from Linux using xmingw. Has anyone tried this? thanks, -- Flávio Codeço Coelhoregistered Linux user # 386432---"Laws are like sausages. It's bet

Re: [Numpy-discussion] rfft different in numpy vs scipy

2006-09-07 Thread Charles R Harris
On 9/7/06, Andrew Jaffe <[EMAIL PROTECTED]> wrote: Hi Charles,Charles R Harris wrote:> On 9/7/06, *Andrew Jaffe* <[EMAIL PROTECTED]> [EMAIL PROTECTED] >> wrote:>> Hi all,>> It seems that scipy and numpy define rfft differently.>> numpy returns n/2+1 complex numbers (so the first and las

Re: [Numpy-discussion] ndarray.count() ?

2006-09-07 Thread rex
Robert Kern <[EMAIL PROTECTED]> [2006-09-07 16:35]: > rex wrote: > > Charles R Harris <[EMAIL PROTECTED]> [2006-09-07 15:04]: > >> I don't know about count, but you can gin up something like this > >> > >> In [78]: a = ran.randint(0,2, size=(10,)) > >> > >> In [79]: a > >> Out[79]: array([0, 1, 0,

Re: [Numpy-discussion] rfft different in numpy vs scipy

2006-09-07 Thread Andrew Jaffe
Hi Charles, Charles R Harris wrote: > On 9/7/06, *Andrew Jaffe* <[EMAIL PROTECTED] > > wrote: > > Hi all, > > It seems that scipy and numpy define rfft differently. > > numpy returns n/2+1 complex numbers (so the first and last numbers are > actually r

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-07 Thread A. M. Archibald
Maybe I should stay out of this, but it seems like constructing object arrays is complicated and involves a certain amount of guesswork on the part of Numeric. For example, if you do array([a,b,c]).shape(), the answer is normally (3,) unless a b and c happen to all be lists of the same length, at

[Numpy-discussion] ISP changeover Tuesday 9/12 7:00 PM Central

2006-09-07 Thread Jeff Strunk
Good afternoon, Unfortunately, our recent change in internet service providers is not working out. We will be switching to a more reliable provider on Tuesday 9/12 at 7:00 PM Central. Please allow for up to two hours of downtime. I will send an email announcing the start and completion of this

Re: [Numpy-discussion] rfft different in numpy vs scipy

2006-09-07 Thread Charles R Harris
On 9/7/06, Andrew Jaffe <[EMAIL PROTECTED]> wrote: Hi all,It seems that scipy and numpy define rfft differently.numpy returns n/2+1 complex numbers (so the first and last numbers areactually real) with the frequencies equivalent to the positive part of the fftfreq, whereas scipy returns n real numb

Re: [Numpy-discussion] ndarray.count() ?

2006-09-07 Thread Robert Kern
rex wrote: > Charles R Harris <[EMAIL PROTECTED]> [2006-09-07 15:04]: >> I don't know about count, but you can gin up something like this >> >> In [78]: a = ran.randint(0,2, size=(10,)) >> >> In [79]: a >> Out[79]: array([0, 1, 0, 1, 1, 0, 0, 1, 1, 1]) > > This exposed inconsistent randint() behav

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-07 Thread Charles R Harris
On 9/7/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: Charles R Harris wrote:>> So is this intentional?>> In [24]: a = array([[],[],[]], dtype=object)>> In [25]: a.shape> Out[25]: (3, 0)>> In [26]: a = array([], dtype=object) >> In [27]: a.shape> Out[27]: (0,)>> One

[Numpy-discussion] rfft different in numpy vs scipy

2006-09-07 Thread Andrew Jaffe
Hi all, It seems that scipy and numpy define rfft differently. numpy returns n/2+1 complex numbers (so the first and last numbers are actually real) with the frequencies equivalent to the positive part of the fftfreq, whereas scipy returns n real numbers with the frequencies as in rfftfreq (i.

Re: [Numpy-discussion] ndarray.count() ?

2006-09-07 Thread rex
Charles R Harris <[EMAIL PROTECTED]> [2006-09-07 15:04]: > I don't know about count, but you can gin up something like this > > In [78]: a = ran.randint(0,2, size=(10,)) > > In [79]: a > Out[79]: array([0, 1, 0, 1, 1, 0, 0, 1, 1, 1]) This exposed inconsistent randint() behavior between SciPy and

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-07 Thread Travis Oliphant
Charles R Harris wrote: > > So is this intentional? > > In [24]: a = array([[],[],[]], dtype=object) > > In [25]: a.shape > Out[25]: (3, 0) > > In [26]: a = array([], dtype=object) > > In [27]: a.shape > Out[27]: (0,) > > One could argue that the first array s

Re: [Numpy-discussion] 2 GB limit for memmap'ed files

2006-09-07 Thread Mike Ressler
On 9/7/06, Glen W. Mabey <[EMAIL PROTECTED]> wrote: A long time ago, Travis wrote:> >  My understanding is that using memory-mapped files for *very* large>  files will require modification to the mmap module in Python ---Did anyone ever "pick up the ball" on this issue? This works with python-2.5 b

Re: [Numpy-discussion] ndarray.count() ?

2006-09-07 Thread Martin Spacek
Great! That's exactly what I wanted. Works with floats too. Thanks, Martin Robert Kern wrote: > Mostly, it's simply easy enough to implement yourself. Not all one-liners > should > be methods on the array object. > >(a == value).sum() > -

Re: [Numpy-discussion] ndarray.count() ?

2006-09-07 Thread Sasha
On 9/7/06, Martin Spacek <[EMAIL PROTECTED]> wrote: > What's the most straightforward way to count, say, the number of 1s or > Trues in the array? Or the number of any integer? > > I was surprised to discover recently that there isn't a count() method > as there is for Python lists. Sorry if this h

Re: [Numpy-discussion] ndarray.count() ?

2006-09-07 Thread Alexander Belopolsky
On 9/7/06, Martin Spacek <[EMAIL PROTECTED]> wrote: > What's the most straightforward way to count, say, the number of 1s or > Trues in the array? Or the number of any integer? > > I was surprised to discover recently that there isn't a count() method > as there is for Python lists. Sorry if this h

Re: [Numpy-discussion] 2 GB limit for memmap'ed files

2006-09-07 Thread Sebastian Haase
Hi Glen ! How is that quote really !? The new Python2.5 *is* implementing the needed changes - so go ahead install Python2.5 (rc1 is the latest I think) and report how it works. I would also be very intersted to hear ;-) -Sebastian Haase On Thursday 07 September 2006 12:34, Glen W. Mabey wro

Re: [Numpy-discussion] ndarray.count() ?

2006-09-07 Thread Robert Kern
Martin Spacek wrote: > What's the most straightforward way to count, say, the number of 1s or > Trues in the array? Or the number of any integer? > > I was surprised to discover recently that there isn't a count() method > as there is for Python lists. Sorry if this has been discussed already,

Re: [Numpy-discussion] ndarray.count() ?

2006-09-07 Thread Charles R Harris
On 9/7/06, Martin Spacek <[EMAIL PROTECTED]> wrote: What's the most straightforward way to count, say, the number of 1s orTrues in the array? Or the number of any integer?  I was surprised to discover recently that there isn't a count() methodas there is for Python lists. Sorry if this has been dis

[Numpy-discussion] ndarray.count() ?

2006-09-07 Thread Martin Spacek
What's the most straightforward way to count, say, the number of 1s or Trues in the array? Or the number of any integer? I was surprised to discover recently that there isn't a count() method as there is for Python lists. Sorry if this has been discussed already, but I'm wondering if there's a

[Numpy-discussion] 2 GB limit for memmap'ed files

2006-09-07 Thread Glen W. Mabey
A long time ago, Travis wrote: > On a related, but orthogonal note: > > My understanding is that using memory-mapped files for *very* large > files will require modification to the mmap module in Python --- > something I think we should push. One part of that process would be > to add the

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-07 Thread Charles R Harris
On 9/7/06, Charles R Harris <[EMAIL PROTECTED]> wrote: On 9/7/06, Travis Oliphant < [EMAIL PROTECTED]> wrote: Charles R Harris wrote:> On 9/6/06, *Charles R Harris* <[EMAIL PROTECTED]> [EMAIL PROTECTED] >> wrote: On 9/6/06, *Travis Oliphant* < [EMAIL PROTECTED] > [EMAIL PROTECTED]>> wr

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-07 Thread Charles R Harris
On 9/7/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: Charles R Harris wrote:> On 9/6/06, *Charles R Harris* <[EMAIL PROTECTED]> [EMAIL PROTECTED] >> wrote: On 9/6/06, *Travis Oliphant* < [EMAIL PROTECTED]> [EMAIL PROTECTED]>> wrote:>> Charles R Harris wrote:> >>   

[Numpy-discussion] reshape: missing arg check?

2006-09-07 Thread Sven Schreiber
Hi, never mind that the following syntax is wrong, but is it supposed to yield that SystemError instead of something more informative? (This is with b5 on win32 and python 2.4.3) >>> b.reshape(3,3,axis = 1) Traceback (most recent call last): File "", line 1, in ? SystemError: NULL result withou

[Numpy-discussion] Fix to Int64/string numexpr support

2006-09-07 Thread Ivan Vilata i Balaguer
Hi all, I've detected some small errors in the patches I sent some time ago for adding Int64 and string support to numexpr (see http://www.mail-archive.com/numpy-discussion%40lists.sourceforge.net/msg01551.html). Basically: * ``numpy.string`` was accessed instead of ``numpy.string_`` (looks like

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-07 Thread Travis Oliphant
Charles R Harris wrote: > OK. I do have a couple of questions. Let me insert the docs for array > and asarray : > > """array(object, dtype=None, copy=1,order=None, subok=0,ndmin=0) > > Return an array from object with the specified date-type. > > 1) Is it true that array doesn't always ret