Hi,

Something I recently noticed in my code and I don't know if it's a
mistake from my part or something that comes from PyTables.

I have some code that goes like this:
from numpy import *
from tables import *

some_array = zeros(len)
some_list = list()

<populate some_array and some_list>

SomeTable = { 'Some':FloatCol( shape=shape(some_array) )}
table = h5_db.createTable( 'somewhere','SomeTable', SomeTable,'SomeTable Desc' )

row = table.row
row['Some'] = some_array
row.append()
table.flush()

Vlarray = 
h5_db.createVLArray('somewhere','SomeArray',StringAtom(flavor='numpy',length=6),'SomeArray
Desc)
Vlarray.append( some_list )

So, basically I have a list which is stored in a VLArray and a numpy
array which I am storing a table row which allows an array.

My problem is that when I retrieve the information from the table I've
noticed that array in the Table has the following shape (1,len) while
the VLArray has (len,). While both look like one dimensional arrays,
they are actually different in numpy and therefore complicate things a
bit. I've checked the output of shape(some_array) and it is (len,); so
I am assuming, that PyTables is doing this change.

I'd like to know if I am write or wrong about this, if this is a
feature or a bug in PyTables and how to possibly avoid it, since I am
interested in storing and retrieving the exact same array that I store
in my DB.

Thanks,
Pepe


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid7521&bid$8729&dat1642
_______________________________________________
Pytables-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to