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?
You can find other debug logs you've downloaded with Visual Studio Code in the . sfdx/tools/debug/logs folder. Right-click any line in the debug log, then choose SFDX: Launch Apex Replay Debugger with Current File.
Go to Run > Start Debugging and select an environment (e.g Node. js (preview) ). From the command-palette, select Debug Visualizer: New View .
In the Variables tab of the Debug tool window, select an array or a DataFrame. Click a link View as Array/View as DataFrame to the right. Alternatively, you can choose View as Array or View as DataFrame from the context menu. The Data View tool window appears.
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:
Run
menu at top have Start Debugging
option)VARIABLES
panel. (VARIABLES
panel is inside Run and Debug
area)View Value in Data Viewer
. TADA :)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
You can now print the DataFrame in the DEBUG CONSOLE:
From the Github issue mentioned in @Christina Zhou's answer.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With