[I'm sending this to the list. Alain, SF seems to have rejected your message. 
Please, make sure that you send messages to the PyTables list from a 
*subscribed* address]

A Dimecres 07 Febrer 2007 12:05, escriguéreu:
> Hi Francesc,
>
>  
>
> I created an Earray with shape = (1,0)
>
>  
>
> a = tables.Float64Atom(shape=(1,0), flavor='numpy')
>
> hdfarray = fileh.createEArray(fileh.root, 'array_float', a, "Floats")
>
>  
>
> I have initialized the array with initial values.
>
> Now I would like to change for example second value : hdfarray[2]= 22.22
>
> This returns index error.
>
> I tried with hdfarray[0][2] this gives no error but the change is not
> effective.
>
>  
>
> I put in attached file a small program reproducing my pbm

This is not bug. The problem is that you have specified the [0,2] element as 
[0][2]. The first index ([0]) returns a numpy array, and the second index 
([2]) returns the third element of this numpy array, so that:

hdfarray[0][2] = 22.22

only modifies the 3rd element of the numpy object *in memory* and does nothing 
more. Use the idiom:

hdfarray[0,2] = 22.22

and your difficulties will fade out.

> P.S. I used the shape (1,0) because it gives me much more powerful
> performance than shape (0,)

More performance? can you send me some figures or benchmarks about this?. I'd 
be interested in solving possible problems here.

Cheers,

-- 
>0,0<   Francesc Altet     http://www.carabos.com/
V   V   Cárabos Coop. V.   Enjoy Data
 "-"

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to