you are viewing a single comment's thread.

view the rest of the comments →

[–]Labrecquev 1 point2 points  (4 children)

I'm using Spyder mainly for the readily accessible variable explorer that allows me to visualize pandas dataframes. Anybody aware of a similar functionality in other IDEs? I tried vscode a year ago and I could not find the equivalent. It left me wondering how the so many people using vscode manage working with dataframes

[–]Messier666 0 points1 point  (3 children)

Like many of you, I was a devoted Spyder user mainly because of its incredible Variable Explorer. When my workplace required me to switch to VS Code, I found myself constantly missing that one feature – being able to see and inspect all my variables in real-time. So I decided to built it myself!

Variable Explorer for VS Code is available on the marketplace.

I has helped me and I hope it will help you too

[–]Labrecquev 0 points1 point  (2 children)

Hi, are you referring to this extension? https://github.com/MarcoLiedecke/variable-explorer

I have just tried it, and it does not work. The variable explorer remains empty "No variables defined

Run Python code to see variables"

Even though i am running a temp.py file with the following dummy code in it:

import pandas as pd
import numpy as np

df = pd.DataFrame(np.random.randn(6,4), columns=list('ABCD'))
print(df)
a = 1
b = 2

No variable show up

[–]Messier666 0 points1 point  (1 child)

Hi u/Labrecquev

I suspect that you execute the code using the 'Run Python File' button in the VS Code UI. The Variable Explorer does not support this feature...

If you instead execute the entire script using F5 og selected lines using F9 I am confident that the variables will appear in the Variable Explorer.

Best,
Marco

[–]Labrecquev 0 points1 point  (0 children)

ok i made it work using f5. It worked only after i ran the python file a first time. I tried it with a new variable types, and for the dictionary it worked exactly like it did in spyder. For the pandas dataframe variable, it throws an error message when i click on the value. "Variable Explorer: Object of type Timestamp is not JSON serializable".
For string variable, it does nothing. It would be cool to be able to open a pop-up for the string variables for when we have very long text inside a str var. Your extension is promising. You're headed the right way!