Hello folks,
  I've been happily using PyTables for a month or two now, but I've run into
a pretty weird problem. I have attached a PyTables file that has a table
with a single row of data from an analysis I am doing. I run this script:


#!/usr/bin/env python

import sys

import tables

fp = tables.openFile('ev697158.h5', mode='r')

print "nrow = ", len(fp.root.nt)
print "t = ", fp.root.nt[0]['t']

cut1 = '1 and (t > -0.4) and (sin(pip1_theta) < 0.5) and (sin(pip2_theta) <
0.5)'
cut2 = '1 and (t > -0.4)'


print len([row for row in fp.root.nt.where(cut1)])
print len([row for row in fp.root.nt.where(cut2)])

and I get the output:

[cra...@fsul1 data]$ python test_cut.py
nrow =  1
t =  -1.65756985531
1
0
Closing remaining open files: ev697158.h5... done


So, the value for the column 't' is -1.657, so both of these cuts should
exclude the event. But, only the bottom one does. When I add cuts
*after*the t cut, I recover the row. It's possible there's something
dumb I am
doing wrong but it seems to me that this should be completely impossible.
This is with the 2.1std branch of the SVN repository:

[cra...@fsul1 data]$ python
Python 2.6.2 (r262:71600, Jul 28 2009, 10:47:31)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tables
>>> print tables.__version__
2.1.2.dev
>>>


Thanks in advance!

Craig

Attachment: ev697158.h5
Description: Binary data

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to