Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

386
Views
View dataframe while debugging in VS Code

I'm trying to explore switching from PyCharm to VS Code. I can't find a way right now to view my pandas DataFrames in a tabular format while debugging.

When I right click on a df object, there is no option to view.

I have the python extension downloaded. Am I missing something?

enter image description here

over 4 years ago · Santiago Trujillo
7 answers
Answer question

0

So it looks like this isn't a thing right now in VS Code.

If anyone wants to show their support for the development of this feature, I found this open issue here: https://github.com/microsoft/vscode-python/issues/7063

over 4 years ago · Santiago Trujillo Report

0

The interactive shell looks like a good start. Right click the .py file in your explorer. You'll be able to view pandas dataframes from there.

over 4 years ago · Santiago Trujillo Report

0

It seems like currently you can do it only using the Jupyter notebook in VS Code, using the variables explorer.
Jupyter Notebook in VScode - variables explorer

over 4 years ago · Santiago Trujillo Report

0

You can now print the DataFrame in the DEBUG CONSOLE:

enter image description here

From the Github issue mentioned in @Christina Zhou's answer.

over 4 years ago · Santiago Trujillo Report

0

My solution for viewing DataFrames in a tabular format while debugging is to simply copy and paste them into an Excel spreadsheet using

df.to_clipboard()

from the debug console. Even some of my colleagues running PyCharm are using this technique, since it gives you way more flexibility to inspect your data.

over 4 years ago · Santiago Trujillo Report

0

Microsoft VSCode team finally made this feature available with latest update of the product. More details could be found in official blog

It works like a charm and is very intuitive. In short:

  1. Set up a break point (by clicking at the left most point of code area, before line number)
  2. Start debugging (Run menu at top have Start Debugging option)
  3. When debugger stops at the debug point, find the required dataframe inside VARIABLES panel. (VARIABLES panel is inside Run and Debug area)
  4. Right click on dataframe and select option View Value in Data Viewer. TADA :)
over 4 years ago · Santiago Trujillo Report

0

you can use the view() function from xlwings library. It will show you the DataFrame in Excel:

import pandas as pd
from xlwings import view

df = pd.DataFrame({'A':[1,2], 'B':[3,4]})
view(df)

A better way would be to convert the function to pandas method:

from pandas.core.base import PandasObject
PandasObject.view = view

now you only need to type:

df.view()
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!