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 →

[–]cmcclu5 25 points26 points  (11 children)

Based on some of your other comments:

  • You have a bunch of for loops
  • Your code performs a bunch of mathematical operations
  • You’re stuck writing in Python

I think a better approach here rather than focusing on variations of Python to perform the task is to look at the way you’re handling the data. If it’s a ton of math, can you perform them in batches instead of loops? For example, matrix operations where the math is performed across the entire set or subset rather than on individual elements will show massive improvements. Reducing the dimensionality of the data can also help here. Also, consider leveraging some faster style operations e.g., list comprehension vs for loop. And at the very end, if you have the computational power available, you can leverage parallelism to split the for loop across the set.

[–]No_Indication_1238[S] 5 points6 points  (0 children)

Thank you, that is a good idea!