Python: Quick Time-Saving Tip of the Day

Using Multiple Cursors to Make Edits in Jupyter Notebook

Daniel Barker
Sep 4, 2018 · 2 min read

One of my favorite things about PyCharm is the ability to repeat edits with multiple cursor locations. This is extremely useful when I want to quickly change the name of something in multiple places, but for whatever reason don’t want to use the built-in ‘refactoring’ function in PyCharm. Until today, I had been pining for similar functionality in Jupyter notebooks, but just realized that the feature is already there!

Say I have a dataframe that I want to plot several columns of, and I’ve already setup the plot of the first column the way I want.

I could retype each individual line, or like any good (lazy?) programmer, I could copy and paste.

Even better, after copying and pasting, if I ‘CTRL + mouse click’ I can make multiple selections and change the column name in one quick edit in the Jupyter Notebook. Great time saver!

Using multiple cursors to make edits in Jupyter Notebooks — Just ‘CTRL + mouse click’ to use

Daniel Barker

Written by

Co-Founder @ Phin | Engineer with a cybernetic bent. Unabashed pseudo-intellectual; can usually be found struggling to capture deeper thoughts in prose ’n code.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade