Created
January 19, 2020 16:07
-
-
Save tnwei/6005afe55cb8898ba87daa36fce23392 to your computer and use it in GitHub Desktop.
Finding first code cell in a Jupyter notebook with Javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.findFirstCodeCell = function findFirstCodeCell() { | |
var cells = Jupyter.notebook.get_cells(); | |
for (var i = 0; i < cells.length; i++) { | |
if (cells[i]["cell_type"] == "code" ){ | |
return i; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment