A Wednesday 27 October 2010 07:01:24 Josh Ayers escrigué:
> Tables have a similar inconsistent behavior, which I've had to work
> around in a few places as well. See the following example code,
> which is very similar to Mario's. "Slice1" is of type numpy.void,
> while "slice2" is of type numpy.ndarray.
>
> h = tables.openFile('test.h5',mode='w')
> dtype = numpy.format_parser(['i4','i4'],['a','b'],[]).dtype
> h.createTable('/','table1',dtype)
> table = h.getNode('/','table1')
>
> newRow = numpy.recarray((2,),dtype)
> newRow[0] = (0,1)
> newRow[1] = (2,3)
> table.append(newRow)
>
> slice1 = table[numpy.array([0,1])]
> type(slice1) # type is numpy.ndarray
>
> slice2 = table[numpy.array([0])]
> type(slice2) # type is numpy.void
Yes, this should be considered a bug. I opened a ticket:
http://pytables.org/trac/ticket/303
Will try to fix this for forthcoming 2.2.1.
Cheers,
--
Francesc Alted
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Pytables-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pytables-users