2010/8/17, Ernesto <e.pica...@unical.it>:
> Hi all,
>
> I have a table with 12 columns and millions of rows. Each column is a
> number, generally 0 or 1.
> I need to quickly update one or two columns in thousands of rows. Moreover,
> this last step can be repeated many times (approximately in the range
> 10-900000).
> At the moment, for each range of rows I use the following loop:
>
> for row in table.iterrows(start=10,stop=100000,step=1):
>       row['col1']=1
>       row['col2']=1
>       row.update()
> table.flush()

I'd say that this is a very efficient method.

>
> I found also the modifyColumns method but I didn't understand very well as
> it worked.

What do you not understand exactly?  I'd recommend you to do a few
tries with modifyColumns() using small tables in interactive mode.
This is usually the best way to learn in Python, and you should make
sure to take advantage of this nice capability.

>
> What is the quick way to update specific columns in a huge set of row
> intervals?
>
> Thank you in advance for any suggestion.
>
> Ernesto

Ciao,

-- 
Francesc Alted

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to