Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show line numbers in Google Colaboratory?

Normally it is possible in jupyter or iPython notebooks to show lines number for a cell, however I don't see where in Google Colaboratory (Colab).

like image 990
Guillaume Chevalier Avatar asked Mar 08 '18 21:03

Guillaume Chevalier


People also ask

How do I make line numbers visible in Jupyter notebook?

CTRL - M L toggles line numbers in the CodeMirror area. See the QuickHelp for other keyboard shortcuts. In more details CTRL - M (or ESC ) bring you to command mode, then pressing the L keys should toggle the visibility of current cell line numbers. In more recent notebook versions Shift-L should toggle for all cells.

How do I get colab output on Google?

Working with Google Sheets Colab also supports rich outputs such as charts. Type in the following code in the Code cell. Note that the graphical output is shown in the output section of the Code cell. Likewise, you will be able to create and display several types of charts throughout your program code.

How do I see function details in Google Colab?

Function Documentation Colab gives you the documentation on any function or class as a context-sensitive help. Now, hit TAB and you will see the documentation on cos in the popup window as shown in the screenshot here. Note that you need to type in open parenthesis before hitting TAB.

How do I run all lines in Google Colab?

To simply have all the cells run automatically, click Runtime > Run all in the colab toolbar.


2 Answers

Yep, the shortcut (Ctrl + M + L) works,

other option is use the bar menu, at tool -> preference -> show line numbers


Update: new path: Tools -> Settings -> Editor -> show line numbers

like image 129
Jason Angel Avatar answered Sep 16 '22 16:09

Jason Angel


Holding Ctrl and pressing ML (one by one) switches on/off line numbers in the cells containing code.

like image 42
arudzinska Avatar answered Sep 18 '22 16:09

arudzinska