3

This is my first time working on Google Colab. Is it possible to use a variable inspector in Google Collab ? And if so, how ?

Thank you.

Rub
  • 2,071
  • 21
  • 37
Nawel
  • 79
  • 2
  • 7
  • you can try making your own, see https://colab.research.google.com/drive/1sYg2maTOT3GrCGS7R7WSxJcM3RsHjHAH#scrollTo=bn4q0OAA0ek5 – Rainb Nov 26 '20 at 16:29

1 Answers1

7

Update: as of 2022-02-22, Colab has its own variable inspector. You can access it from the left panel.

enter image description here


Yes. This is how I do it.

Place this code into one code cell and run it.

from google.colab import output
#I don't know why nbextensions don't work with python3.6 
with output.temporary():
  !pip install --upgrade git+https://github.com/Kreijstal/colab_inspector.git 
  !python2.7 -m pip install --upgrade git+https://github.com/blois/colab_inspector.git #yes, really.
  !jupyter nbextension install --py inspector

import inspector

# open a scratch cell (Ctrl+Alt+N)
# run there
# inspector.watch_globals()

Open a scratch cell (Ctrl+Alt+N)

On it, run

inspector.watch_globals()

And as you code on the left you will see the variables updated automatically on the right. You can even expand dictionaries and other stuff.

enter image description here

enter image description here

References:

Keywords: Google Colab, variable explorer inspector visualize

Rub
  • 2,071
  • 21
  • 37