Re: [Python-ideas] A conditional "for" statement

On Thu, 23 Apr 2009 19:09:14 -0400, Mike Meyer wrote:
Ok, I'll admit when I'm wrong. It actually takes longer to use the list comprehension (for all exclusion percentages), which, for me at least, is completely unintuitive. For 1 million samples: excluded: 0%, comprehension time: 0.840000 excluded: 0%, if time: 0.530000 excluded: 10%, comprehension time: 0.770000 excluded: 10%, if time: 0.520000 excluded: 20%, comprehension time: 0.710000 excluded: 20%, if time: 0.490000 excluded: 30%, comprehension time: 0.670000 excluded: 30%, if time: 0.460000 excluded: 40%, comprehension time: 0.610000 excluded: 40%, if time: 0.450000 excluded: 50%, comprehension time: 0.560000 excluded: 50%, if time: 0.420000 excluded: 60%, comprehension time: 0.510000 excluded: 60%, if time: 0.400000 excluded: 70%, comprehension time: 0.450000 excluded: 70%, if time: 0.380000 excluded: 80%, comprehension time: 0.410000 excluded: 80%, if time: 0.350000 excluded: 90%, comprehension time: 0.360000 excluded: 90%, if time: 0.330000 excluded: 100%, comprehension time: 0.310000 excluded: 100%, if time: 0.300000 I hereby accept the rejection of this idea since it makes sense neither from a syntax nor efficiency point of view. Best Regards, Mike
participants (2)
-
Greg Ewing
-
Michael S. Gilbert