Hi !
I have a problem with the numpy datatypes and the Table.where method.
something like
for item in numpy_list:
print [row for row in table.where(table.cols.item==item)]
fails, if numpy_listis a list of numpy integers.
Traceback (most recent call last):
File "createDisjointSets.py", line 101, in ?
createDisjointSets(sys.argv[1])
File "createDisjointSets.py", line 90, in createDisjointSets
copyTable(fLambda.root.events.eventHeader, events, uniqueLambdas)
File "createDisjointSets.py", line 62, in copyTable
rows = [row.nrow for line in selector for row in source.where(
source.cols.event_id == line['event_id'])]
File
"/nfs/slac/g/lcd/mc/prj/sw/extern/python2.4/lib/python2.4/site-packages/tables/Table.py",
line 763, in where
return self._whereIndexed(condition, start, stop, step)
File
"/nfs/slac/g/lcd/mc/prj/sw/extern/python2.4/lib/python2.4/site-packages/tables/Table.py",
line 823, in _whereIndexed
ncoords = condition.index.getLookupRange(condition)
File
"/nfs/slac/g/lcd/mc/prj/sw/extern/python2.4/lib/python2.4/site-packages/tables/Index.py",
line 607, in getLookupRange
raise TypeError("""\
TypeError: Bounds (or range limits) for integer columns can only be ints or
floats.
I can make it work by casting item to an int, but I really don't want to.
(In some cases I can't)
The flavor of the table is numpy and the size (in bytes) of the datatypes is
the same
Is this a bug, or am I just doing something silly and there is a better way
to do things?
Thanks,
Jan
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Pytables-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pytables-users