A Dimarts 13 Febrer 2007 17:34, Francesc Altet escrigué:
> Dear Sergey,
>
> A Dimarts 06 Febrer 2007 09:38, escriguéreu:
> > Hello.
> >
> > I'm using pytables to store log data, may be this usage is not common,
> > and I faced with some trouble. I use Table.where to get interesting row,
> > and I get needed row, but I cannot get the whole row at once! I can
> > access a single column in row with __getitem__, I can get row number, and
> > I can get interesting data as string! So I must or walk columns manually,
> > or re-query table with number, or eval returned string - anyway losing
> > time.
>
> [snip]
>
> Yeah. You are very right. I think that implementing a way to fetch one
> entire row at a time would be a nice improvement for the Row interface. In
> addition, now that NumPy will be at the core of PyTables 2.0, this
> shouldn't be too difficult to implement (a table row can be represented by
> a numpy scalar of type void).
>
> I'm think about something like:
>
> row[:] which would let doing things like
>
> [row[:] for row in table.where('col1>.3')]
>
> Another possibility would be:
>
> row.fetch_all_fields()
>
> which is more explicit, but I think the first one would be easier to use
> (and moreover, most people should be used to the extended slicing
> notation).

Mmm, after considering this a bit more seriously, I think that I'll go towards 
implementing the alternative:

row.fetch_all_fields()

because:

- It would be simpler and more efficient to implement (i.e. Row.__getitem__ 
will not be cluttered with more logic).

- Accepting a [:] would make users think that complete extended slicing suport 
(like [colstart:colstop:colstep]) would be implemented and it will be not (at 
least initially).

Advices are accepted, though.

Cheers,

-- 
>0,0<   Francesc Altet     http://www.carabos.com/
V   V   Cárabos Coop. V.   Enjoy Data
 "-"

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to