Python Forum
Reading a table generated using PyTables - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: Reading a table generated using PyTables (/thread-29743.html)



Reading a table generated using PyTables - Robotguy - Sep-18-2020

Hello,

I have a table with three columns and multiple rows. I know how to extract specific rows using table[0:5]. How can I extract just the elements of first two columns for these 5 rows?

Here is what I tried to extract the rows:


infile = 'table.h5'

f2 = tables.open_file(infile, "r")

table = f2.root.dataset_1.read()

print(table[0:5])  #this gives me five rows with all columns



RE: Reading a table generated using PyTables - Larz60+ - Sep-18-2020

show runnable code, and please, where did you get this package from?
PyPi's closest entry is pytables, last updated 2008.