Scott David Daniels wrote:

> Scott David Daniels wrote:

>      t = timeit.Timer('sum(part[:-1]==part[1:])',
>                       'from __main__ import part')

What happens if you calculate the sum in numpy? Try

t = timeit.Timer('(part[:-1]==part[1:]).sum()',
                 'from __main__ import part')


Peter

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to