I want to know if there is anything like MATLAB's Workspace? (or Spyder's Variable Explorer). So we can easily copy the values out. Something look like this:
I ask it here (https://github.com/jupyter/notebook/issues/1516), Carreau gives a very good example. In short, you can get the variables by this:
variables = %who_ls
for v in variables:
print v, type(eval(v)).__name__, str(eval(v))
Another thing worth considering is spyderlib.plugins.variableexplorer from Spyder. This could be seen at http://stackoverflow.com/questions/2960864/how-can-i-save-all-the-variables-in-the-current-python-session
rodeo has such a thing:
https://github.com/yhat/rodeo/blob/921ad700c432f5510f1b368c16d1acc7b361de2a/src/browser/jsx/containers/variable-viewer.jsx
https://github.com/yhat/rodeo/blob/0b4a9ed5acf052fa9e2eca9427263b5dc44c187d/src/node/kernels/python/langs/python-patch.py
I would also love to see such a thing! On the other hand: isn't that what the jupyterhub jupyterlab stuff is also about?
@janschulz Never thought of Rodeo, I thought it was about desktop version.
Never heard of jupyterlab, is it this? https://github.com/jupyter/jupyterlab
rodeo isn't a notebook app, but also uses the kernel infrastructure and has a browser UI (Rodeo (and RStudio on which rodeo is based) are basically a browser window).
RE jupyterlab: I've heard some stuff about it (there was a survey which (also) said "we need more IDE feature in the Notebook UI" and I think jupyterlab is building infrastructure for suchthings) but I've actually no clue what the overall vision is for that thing...
The original answer in the notebook repo linked to https://github.com/ipython/ipywidgets/blob/master/docs/source/examples/Variable%20Inspector.ipynb -> doesn't look so complicated :-)
@janschulz Yes, that widget is pretty amazing and simple. The problem is that how to make it "copy and pastable", i.e. have table display UI for array and matrix.
Addtionally, I personally want a Ruby on Rails-like framework for Jupyter Notebook, in which have pre-load common use nbextensions, libraries and good file organizations. It can help people get to know useful features, extentions at the beginning, saving people tons of time for configuration.
to be cross-language-compatible we need a protocol extension AFAICS:
@cqcn1991 to get what you want right now, you can do something like
from IPython.core.page import page
from IPython.core.formatters import format_display_data
page(format_display_data(thing, ['text/plain', 'text/html']))
(the second argument to format_display_data is only for performance since the pager can鈥檛 handle more mimetypes anyway)
@flying-sheep what is thing in page(format_display_data(thing, ['text/plain', 'text/html']))?
the variable you want to display. to get it there鈥檚 a bit more work involved:
thing = ipython.kernel.shell.user_ns[varname]Would be a great feature!
How about the Variable Inspector extension?
Does the variable inspector work in Jupyterlab?
Does the variable inspector work in Jupyterlab?
No, jupyterlab uses a different (and so far still constantly-changing) javascript model, so I know of no extensions that work there yet
A varInspector is planned in the future in JupyterLab, see the roadmap.
Also, it is planned in the notebook development roadmap for Jupyter v 5+ to port/bridge popular nbextension "we will continue to work on porting nbextensions to JupyterLab and building the bridge layers." and "At least some important, popular extensions are ported / bridged to Jupyter Lab". Of course we will be happy to port or help, but for now the interface seems not quite stable and/or I don't find easy keys.
How about the Variable Inspector extension?
This works for simple variables, but a better presentation (i.e. like that of in Spyder) of dataframes/matrices/vectors is much appreciated.
Alternatively, I also tried running jupyter notebooks inside spyder, this did not work well.
@ biocyberman, i think i'm exactly looking for the same like you. Did you find a better variable explorer than the variable inspector in Jupyter?
Most helpful comment
How about the Variable Inspector extension?