Hi ,
5 years ago, my data science "superpower" was code optimisation.
I could take a piece of analysis code that took 30 minutes to run, and with a few tweaks, make it run in 2
seconds or less.
Spoiler alert: the secret is vectorisation using NumPy.
It was a trick I picked up while doing my Computer Science Masters, where several assignments included strict runtime constraints.
In fact, I got so good at doing this, that I often found myself spending hours optimising code, even when the potential benefits were trivially small - shaving off microseconds and making my code marginally more elegant and precise.
By the time I'd finished, my code was a
work of art.
Here's the thing...
Nobody cared.
Yes, writing functional, efficient code is important.
But at the end of the day, unless you're working in a high-performance computing environment (such as stock-trading or self-driving cars), it usually doesn't matter if your code runs in 2 seconds instead of 10.
This is the trap so many technical people fall into. We
optimise the wrong things.
We spend hours perfecting code that already works well enough for the business problem at hand.
The business doesn't care if your code is beautiful. They care if it solves their problem.
Focus on getting the right answer to the right question quickly. Optimise for business impact, not the elegance of your code.
Talk again soon,
Dr Genevieve Hayes.