Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

388
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório

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 Relatório

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 Relatório

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 Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda