On Jul 1, 7:02 pm, Paul Rubin <http://phr...@nospam.invalid> wrote: > Carl Banks <pavlovevide...@gmail.com> writes: > > random.shuffle() is still better when you're iterating through the > > whole list as the OP was doing. > The OP wrote: > > I want to select, 70% random records from a List. I thougth set > where a good idea so I tested this way: ...
I was going by his example which went through all the items in the list. > That sounds like 70% of the list, not the whole list. Note that > in addition to using time proportional to the size of the entire > lsit rather than the size of the sample, shuffle() also messes up > the order of the list. > > Why would shuffle ever be better? Because we were talking about different things. Carl Banks -- http://mail.python.org/mailman/listinfo/python-list