Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

387
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar

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 Denunciar

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 Denunciar

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 Denunciar

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda