Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spyder-Like variable explorer #1148

Open
YashKarthik opened this issue May 4, 2020 · 44 comments
Open

Spyder-Like variable explorer #1148

YashKarthik opened this issue May 4, 2020 · 44 comments
Assignees
Labels
data-viewer feature-request Request for new features or functionality variable-explorer

Comments

@YashKarthik
Copy link

Feature: Variable explorer

The variable explorer in the notebooks is a important part of many data science IDEs, though vscode is not a full blown IDE I prefer it over others, its amazing. Vscode has a amazing features, just that the variable explorer doesn't feel/look so good, an explorer like in spyder or even Pycharm would be a nice feature and I'm sure many ppl would like that interface.
Thanks

@DavidKutu
Copy link

DavidKutu commented May 4, 2020

Thanks for your feedback @YashKarthik. We'll discuss this feature in our next triage.

@YashKarthik
Copy link
Author

👍🏻👍🏻 @DavidKutu

@YashKarthik
Copy link
Author

@greazer , the variable explorer in the vscode Jupiter notebooks cover a lot of vertical space, whereas it'll be more convenient if it were on part the activity bar and have a squarish panel when opened. Also a data frame viewer like one in Jupyterlab would also be a nice feature.

@jasonboh
Copy link

jasonboh commented Jul 22, 2020

Spyder has the very useful ability of viewing all kind of Python objects in the Variable Explorer. Currently, VS Code's Variable Explorer is very limited compared to the type of objects one can view in Spyder. For example, if I create Python class and then create a variable that stores an instance of that class, the Spyder variable explorer lets me double click on the instance variable and see all attributes. And I can keep descending into the hierarchy by double clicking. For example, if an attribute stores a list, I can double click on the attribute and view all element of the list. If the attribute is a nametuple or dict or set some other built-in Python object, I can double click on it and it open the view of that object. You can also actually edit values within a list, or dict
or whatever and then interact with the edited values in the kernel. My understanding is that MATLAB behaves similarly (I don't know from personal experience). But the variable Explorer is one of the most-loved features in Spyder, so adding similar capabilities to VS Code would be great!

@jontis
Copy link

jontis commented Aug 2, 2020

Yes! Though VS Code has come a long way, the variable explorer is still the reason I chose Spyder every time for Data Science tasks.

@jasonboh
Copy link

jasonboh commented Aug 4, 2020

Me too. I find VS Code's current Variable Explorer is of super-limited use to me. However, VS Code offers so many other great features that Spyder does not. So, if VS Code could just close this one huge gap, it would be fantastic.

@bibinvargheset
Copy link

bibinvargheset commented Nov 8, 2020

Me too. I find VS Code's current Variable Explorer is of super-limited use to me. However, VS Code offers so many other great features that Spyder does not. So, if VS Code could just close this one huge gap, it would be fantastic.

The above comments are very relevant and the redirected issue is closed. The variable explorer is needed for both the python interactive window as well as the normal python window.

Py charm has a good variable explorer and Virtual environment set up.

@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 13, 2020
@Ikhwansong
Copy link

I agree with them. So please improve the 'variable explorer'

@NikilXYZ
Copy link

NikilXYZ commented Apr 15, 2021

I agree - this is especially useful for matrices and csv / table type data.
The one reason I use spyder (if I'm using Python) or use R studio (if I'm using R) instead of VS Code for scientific computing, data science, or image processing.

@johan-lorentzon
Copy link

I agree, I'd love to be able to use VS Code for scientific python since it's far superior to Spyder in other aspects but a working variable explorer and data viewer is an absolute requirement for a scientific IDE. The current VS Code one has too limited capabilities and also is far too slow to be useful.

@jasonboh
Copy link

jasonboh commented May 8, 2021

@DonJayamanne @DavidKutu Hi guys, just to expand upon the request.... It would be great if the focus wasn't only on "data viewing". yes, that's important, but a more general, all-purpose variable viewer would be useful, where users could see all attributes and methods of each object alive in the kernel. This is what Spyder offers. It's not just a viewer for data objects.... it's a viewer for ALL variables, not matter their type. I believe that Spyder pickles objects in order to view their attrs and methods in the Variable Explorer. You can double click on any object and keep descending into the hierarchy of the objects inside of them. And, regarding data viewing, currently complex numbers are not supported in the Data Viewer. This is a requirement for my field of engineering.

@NikilXYZ
Copy link

NikilXYZ commented May 8, 2021 via email

@DonJayamanne
Copy link
Contributor

What you're after is mentioned here:#5532

  • Variable explorer for all data types, dictionary, plots, widgets, pickle objects, etc.
  • and then bring able to explore each variable (expanding ducts/pickled objects, opening plots in separate windows, opening widgets in a separate windows)

@jbiz25, @NikilXYZ
Please upvote #5532 that issue if that's what you're after

@jasonboh
Copy link

jasonboh commented May 8, 2021

That's exactly it. Will upvote. Thanks @DonJayamanne

@mho21
Copy link

mho21 commented May 10, 2021

Thank you for picking up! as this drawback of vscode is the only reason I still use intellij right now, upvote both issue! #5532

@kickbone
Copy link

Could not agree more. Looking forward to an upgraded variable explorer in VS Code!

@IsaiahvH
Copy link

IsaiahvH commented Jan 7, 2022

As far as I know, the current variable explorer also does not offer a way to search for a variable by name.
When there is many variables, scrolling in a small window becomes tedious and it would be great if this feature would also be considered.

@Y-H-Joe
Copy link

Y-H-Joe commented Feb 16, 2022

another vote here!

@Aizenz
Copy link

Aizenz commented Feb 17, 2022

Vote for a better variable explorer too.
The color indicating the size of variable is really helpful!

@ldorigo
Copy link

ldorigo commented Mar 2, 2022

+1. Also, I'm wondering if you couldn't "just" re-use the variable viewer that is used in the debugger? I find it 10x better in terms of interactivity than the current "JUPYTER: VARIABLES" pane.

@KangOxford
Copy link

Please add a variable explorer!

@DonJayamanne
Copy link
Contributor

More suggestions from here #11679

  • showing a dataframe is fast
  • it is opened in its own window that you can enlarge at will
  • all columns are much wider and they can be even resized automatically

@Cglezf
Copy link

Cglezf commented Jan 20, 2023

Please add a variable browser!!!

@mateuszrenno
Copy link

I agree! Spyder variable explorer is the best.

@jmew
Copy link
Contributor

jmew commented Jul 19, 2023

Just wanted to share this extension from Microsoft that integrates with Notebooks in VS Code, to allow you to open any Pandas DataFrame in an interactive data wrangler

https://marketplace.visualstudio.com/items?itemName=ms-toolsai.datawrangler

image

image

@Cglezf
Copy link

Cglezf commented Nov 28, 2023

That not resolve the inspector variables (Spyder-like) for object. Sometimes we need to explore the variables within the objects.

@starball5
Copy link

What's the relationship between this issue ticket and the work being done with microsoft/vscode#165445?

@BENSONCHIEN
Copy link

After almost 4 years, another vote here!

Because vscode github copliot and Spyder variable explorer..., I keep switching between the two IDEs.

@amunger
Copy link
Contributor

amunger commented Apr 10, 2024

you can try out the experimental built-in variable view with "notebook.experimental.variablesView": true - A "Notebook Variables" section should show up in the run/debug sidebar when a python kernel from the jupyter extension is running. It still needs some polish, but should be closer to what is asked for here.

@wrgrant
Copy link

wrgrant commented Jul 1, 2024

Nice @amunger !!
This is a great start and covers everything I need for script development.

@NikilXYZ
Copy link

NikilXYZ commented Jul 2, 2024 via email

@WhiteRavenTechnology
Copy link

you can try out the experimental built-in variable view with "notebook.experimental.variablesView": true - A "Notebook Variables" section should show up in the run/debug sidebar when a python kernel from the jupyter extension is running. It still needs some polish, but should be closer to what is asked for here.

Well I thought this was gonna be it. Can't view dataframes in any kind of dataviewer, and apparently when a variable becomes sufficiently complex (dictionary with nested dataframes), the "Notebook Variables" section just empties itself and stops working. Can't figure out what it is about my specific code that's causing it. The "Jupyter" variables tab is more useful than this since it at least doesn't empty itself.

Interestingly, when debugging, the normal variable viewer DOES work fine and allow me to dig into my dictionary objects and view dataframes in a data viewer from there (of course it says the dataviewer is going to be deprecated in favor of DataWrangler because why would we want something native that works instead of a bloated extension that doesn't).

I just want to be able to expand my dictionaries and view the dataframes contained on them. PyCharm does it. Spyder apparently does it. VS Code ALMOST does it perfectly when debugging.

This is nuts.

@amunger
Copy link
Contributor

amunger commented Aug 2, 2024

@WhiteRavenTechnology - the bug you mentioned with the dictionary object would is the kind of thing that we want to find while the feature is still experimental, so if you have a repro object, let us konw.

And DataWrangler's data viewer should be hooked up to the new variable explorer soon.

@BrazilForever11
Copy link

How can I try notebook.experimental.variablesView? I pasted it into search bar, but nothing came back.

@BrazilForever11
Copy link

I managed to get it work notebook.experimental.variablesView with Data Wrangler extension. I guess here is the bug tracker: #15141

This seems to work in notebook. Would it be possible to have it in flat python file?

@ejuliaschulz
Copy link

How can I try notebook.experimental.variablesView? I pasted it into search bar, but nothing came back.

Click on File --> Preferences --> Settings (Or just Ctrl + ,), in the search bar of the window that opened up you can type notebook.experimental.variablesView, this will show the respective setting.

This is a great step forward, thank you @amunger !
Would be amazing to have it for flat python files as well.

@amunger
Copy link
Contributor

amunger commented Nov 6, 2024

The setting ID was updated to just notebook.variablesView, since at some point it won't be experimental, but the old setting key will still work.

The new variable view is available for plain python if you use the native python REPL by setting python.REPL.sendToNativeREPL to true, or the Interactive Window from the jupyter extension if you want to work with jupyter kernels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data-viewer feature-request Request for new features or functionality variable-explorer
Projects
None yet
Development

No branches or pull requests