New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wierd error with a comparison #278
Comments
Hi @doris75,
Can toy please provide more info about your platform ( e.g. using |
Hi @sddtest examples]$ python
Error I get So below my program #NEVENTS = 10000 Particle descriptionclass Measurement(IsDescription): # Create a new table for eventst1 = time() Choose this line if you want data compressiontable = fileh.create_table(group, 'test', Measurement, "A table", Filters(9),EXPECTEDROWS) Fill the table with eventsnumpy.random.seed(1) # In order to have reproducible results t1 = time() Add the number of events as an attributetable.attrs.stoptime = time() Open the file en read only mode and start selectionsprint "Selecting events..." print "Selecting values for channel :TEST-COMM-FC:VAR1-CH1", print "Variable TEST-COMM-FC:VAR1-CH1 value between start time and start time+ 10sec:", fileh.close() Thanks and let me know if you need more information |
sounds that the program didn't appear well 2013/8/21 Antonio Valentino notifications@github.com
|
This is a bit old so will close. Feel free to reopen it if needed. |
I'm new to Pytables and wanted to perform some tests on reading big tables.
So what i did is I created a Pytable with 64000000 entries. As the table is big, i set the expectedrows. if i set this parameter to a higher value than actual size (like ten times) , then i'm getting the following error when i'm performing some queries but i really don't understand why. But when I set the expectedrows less than the actual size, then all queries are Ok.
print "Selecting values for channel :TEST-COMM-FC:VAR1-CH1",
nrows = 0; t1 = time()
for row in table.where('physicsname == "TEST-COMM-FC:VAR1-CH1"'):
nrows += 1
print nrows
print "Done --- Time:", round((time()-t1), 3), "sec"
print "Variable TEST-COMM-FC:VAR1-CH1 value between start time and start time+ 10sec:",
nrows = 0; t1 = time()
for row in table.where('(physicsname == "TEST-COMM-FC:VAR1-CH1") & (smpl_nb <1000)'):
nrows += 1
print nrows
print "Done --- Time:", round((time()-t1), 3), "sec"
Selecting values for channel :TEST-COMM-FC:VAR1-CH1 2000000
Done --- Time: 38.338 sec
Variable TEST-COMM-FC:VAR1-CH1 value between start time and start time+ 10sec:
Traceback (most recent call last):
File "testboardwithcompression.py", line 80, in
for row in table.where('(physicsname == "TEST-COMM-FC:VAR1-CH1") & (smpl_nb <1000)'):
File "tableextension.pyx", line 891, in tables.tableextension.Row.next (tables/tableextension.c:9448)
File "tableextension.pyx", line 951, in tables.tableextension.Row.__next__indexed (tables/tableextension.c:9930)
File "tableextension.pyx", line 437, in tables.tableextension.Table._convert_types (tables/tableextension.c:5469)
File "tableextension.pyx", line 461, in tables.tableextension.Table._convert_types (tables/tableextension.c:5355)
File "tableextension.pyx", line 431, in tables.tableextension.Table.convert_time64 (tables/tableextension.c:4975)
ZeroDivisionError: integer division or modulo by zero
Closing remaining open files: /tmp/measurement-2.h5... done
table declaration is
class Measurement(IsDescription):
#event_id = Int32Col(pos=1, indexed=True) # event id (indexed)
start_time = Time64Col(pos=1)
physicsname = StringCol(41, pos=2) # CBS1-CBS2-CBS3:VARNAME
smpl_nb = Int32Col(pos=3) # event id (not indexed)
rawval = Float64Col(pos=4) # particle id in the event
The text was updated successfully, but these errors were encountered: