Optimize Python Code in Jupyter Notebook

Bored waiting for a slow Python job to finish? Let’s find the bottleneck and optimize it.

Winson Waisakurnia
Towards Data Science
5 min readFeb 19, 2020

--

Video by PIRO4D on Pixabay

Want to make a slow Python code fast in Jupyter Notebook? By using sum aggregate as an example, we will measure the runtime with %%time and find the bottleneck using %lprun line profiler.

Function to Optimize: Sum…

--

--

Data Scientist | ex Software Engineer in Data Team | Computer Science @ Bandung Institute of Technology