Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyTables Column to normal python list

I am playing around with PyTables, and stumbled into something I thought would be obvious. I am following the tutorial, but I guess I misunderstand.

I have a PyTables Column object and I want to transfer it's contents to list or numpy array.

So I was hoping there would be something like:

mylist = h5file.root.mygroup.mytable.cols.mycolumn.to_array()

I suppose I could iterate, and put each value separately in the list, but I am wondering if I could somehow extract it directly.

Thanks!

like image 759
devboell Avatar asked Dec 07 '25 00:12

devboell


1 Answers

Try this:

mylist = h5file.root.mygroup.mytable.cols.mycolumn[:]
like image 108
eumiro Avatar answered Dec 08 '25 16:12

eumiro



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!