Re: [Numpy-discussion] insanely slow writing to memory mapped array

2006-11-29 Thread Charles R Harris
On 11/29/06, Mathew Yeates <[EMAIL PROTECTED]> wrote: whoa. I just found out that A=A.transpose() does nothing but change A's flags from C_CONTIGUOUS to F_CONTIGUOUS!! Okay, so heres the question .. I am reading data into the columns of a matrix. In order to speed this up, I want to read va

Re: [Numpy-discussion] insanely slow writing to memory mapped array

2006-11-29 Thread Charles R Harris
On 11/29/06, Mathew Yeates <[EMAIL PROTECTED]> wrote: whoa. I just found out that A=A.transpose() does nothing but change A's flags from C_CONTIGUOUS to F_CONTIGUOUS!! Okay, so heres the question .. I am reading data into the columns of a matrix. In order to speed this up, I want to read va

Re: [Numpy-discussion] insanely slow writing to memory mapped array

2006-11-29 Thread Mathew Yeates
whoa. I just found out that A=A.transpose() does nothing but change A's flags from C_CONTIGUOUS to F_CONTIGUOUS!! Okay, so heres the question .. I am reading data into the columns of a matrix. In order to speed this up, I want to read values into the rows of a matrix and when I am all done,

Re: [Numpy-discussion] insanely slow writing to memory mapped array

2006-11-29 Thread Mathew Yeates
Hmm I'm trying to duplicate the behavior with a simple program - import numpy datasize=5529000 numrows=121 fd=open("biggie","w") fd.close() big=numpy.memmap("biggie",mode="readwrite", shape=(numrows,datasize),dtype=numpy.float32) c=numpy.ones(shape=(datasize,),dtype=numpy.float32) for r

Re: [Numpy-discussion] insanely slow writing to memory mapped array

2006-11-29 Thread Robert Kern
Mathew Yeates wrote: > Hi > > I have a line in my program that looks like > outarr[1,:] = computed_array > where outarr is a memory mapped file. This takes forever. > > I checked and copying the data using "cp" at the command line takes 1 > or 2 seconds. So the problem can't be attributed simp

[Numpy-discussion] insanely slow writing to memory mapped array

2006-11-29 Thread Mathew Yeates
Hi I have a line in my program that looks like outarr[1,:] = computed_array where outarr is a memory mapped file. This takes forever. I checked and copying the data using "cp" at the command line takes 1 or 2 seconds. So the problem can't be attributed simply to disk i/o. Is it because the el

Re: [Numpy-discussion] array with object

2006-11-29 Thread Christopher Barker
Torgil Svensson wrote: > It works if you replace the strings '2','3','5','6' with numbers instead. duh! I can't believe I didn't see that! -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (2

Re: [Numpy-discussion] array with object

2006-11-29 Thread Torgil Svensson
It works if you replace the strings '2','3','5','6' with numbers instead. This case got a better error-message: >>> array(['2'],dtype=float32) Traceback (most recent call last): File "", line 1, in ? TypeError: a float is required //Torgil On 11/29/06, Lionel Roubeyrie <[EMAIL PROTECTED]> wr

Re: [Numpy-discussion] array with object

2006-11-29 Thread Christopher Barker
Lionel Roubeyrie wrote: > Hi all, > I don't understand why can't I do that: > b=array([(datetime.datetime(2006,11,29),'2','3'), > (datetime.datetime(2006,11,30),'5','6')], dtype=[('Dates', 'object'), > ('HUM', 'float32'), ('TEM', 'float32')]) > ValueError: tried to set void-array with object member

Re: [Numpy-discussion] dtype inconsistancy?

2006-11-29 Thread Pierre GM
On Wednesday 29 November 2006 14:41, [EMAIL PROTECTED] wrote: > Hi, > > I think that the following command and result are a little bit inconsistant > and a source of error. I don't understand why: dtype=float32 for a result > when it's invalid in the definition. I'm afraid I don;t understand the l

Re: [Numpy-discussion] dtype inconsistancy?

2006-11-29 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Hi, > > I think that the following command and result are a little bit inconsistant > and a source of error. I don't understand why: dtype=float32 for a result > when it's invalid in the definition. float32 is an object in the numpy module, i.e. to access it, you must

[Numpy-discussion] dtype inconsistancy?

2006-11-29 Thread humufr
Hi, I think that the following command and result are a little bit inconsistant and a source of error. I don't understand why: dtype=float32 for a result when it's invalid in the definition. N. In [8]: a = numpy.array([1],dtype=float32) --

Re: [Numpy-discussion] fromiter and objects

2006-11-29 Thread Travis Oliphant
Tim Hochberg wrote: >things are often not as easy as they appear, the real reason I'm writing >is this comment that explains why object arrays are disallowed in >fromiter (multiarraymodule.c::PyArray_:FromIter) > >/* We would need to alter the memory RENEW code to decrement any >

[Numpy-discussion] array with object

2006-11-29 Thread Lionel Roubeyrie
Hi all, I don't understand why can't I do that: b=array([(datetime.datetime(2006,11,29),'2','3'), (datetime.datetime(2006,11,30),'5','6')], dtype=[('Dates', 'object'), ('HUM', 'float32'), ('TEM', 'float32')]) ValueError: tried to set void-array with object members using buffer. Thanks -- Lionel R