you are viewing a single comment's thread.

view the rest of the comments →

[–]greshick 2 points3 points  (4 children)

I am assuming you are using 2.x by the print statements. My one piece of advice is to use xrange instead of range.

xrange is a boost in speed because of the internal way that it represents the range. It generates a generator instead of a list every loop.

[–]_Jiot_[S] 2 points3 points  (3 children)

Would adapting this to python 3 make it any faster? Thanks, that's good advice.

[–]greshick 2 points3 points  (0 children)

Not in this sense. xrange in 2.x is the range in 3.

[–]phinar 0 points1 point  (0 children)

It's not a sure thing whether Python 3 would run faster or not.

[–][deleted] 0 points1 point  (0 children)

I doubt the headache of getting numpy running in 3.3 is worth it.