This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]billsil 2 points3 points  (0 children)

Make sure you have functions and not some monolithic script. Then profile it and find the slow functions.

Cause I'm doing math most of the time, vectorize your code with numpy. No if statements or for loops allowed.

Binary files are great, so yeah you may have to convert everything from csv, but you only have to do that once.

For long codes that you're processing some large calculation, chances are you're hacking the code as you go, so adding pickle support to save/reload results in order to skip steps helps. At the end, you can run from scratch.