Search code examples
pythonpandasvisual-studio-codekeyboard-shortcutsvscode-extensions

Is it possible to create a shortcut that opens a data viewer for the dataframe under cursor with vscode-jupyter?


New vscode user here. Just discovered the python interactive mode in the vscode-jupyter extension and it seems quite powerful.

I was wondering if it is possible to implement a shortcut that will open the data viewer window associated with the dataframe under the cursor?

Here is a quick sketch of what the workflow can look like

  1. Move the cursor to df enter image description here
  2. Execute the line if df is not yet defined enter image description here
  3. Move the cursor to the interactive python group so as to see df in the jupyter: variables tab enter image description here
  4. Open the data viewer window associated with df enter image description here

I am willing to take a shot at implementing this shortcut, but as stated above, I am quite a newbie in vscode. Before getting started I would therefore love to hear from you if it is difficult to implement this shortcut (or even simply feasible)? Are the required functions exposed by the vscode-jupyter API?

Any other pointers that can help me are of course very welcome :)


Solution

  • It seems impossible for now, and it's illogic, as you need to select the variable which you want to expose.