pandas 如何在 vscode 中打印出熊猫数据帧

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/48958312/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 05:14:11  来源:igfitidea点击:

how to print out panda dataframes in vscode

pandasvisual-studio-code

提问by foobar8675

In a terminal, i can print out the value of a dataframeand it prints out in a readable way

在终端中,我可以打印出 a 的值dataframe并以可读的方式打印出来

enter image description here

在此处输入图片说明

Where as in vscode, when running in a debugger, it prints out as one long row and is hard to read.

在 vscode 中,当在调试器中运行时,它会打印出一长行并且难以阅读。

enter image description here

在此处输入图片说明

any suggestions on how to make it more readable on vscode?

关于如何使其在 vscode 上更具可读性的任何建议?

采纳答案by galibhkhan

Try Changing the terminal of VScode to 'git bash' in the terminal tab. It has worked for me.

尝试在终端选项卡中将 VScode 的终端更改为“git bash”。它对我有用。

screenshot1

截图1

screenshot2

截图2

回答by foobar8675

I ended up using the vscode Python:Terminal (external), and within the debug environment, I can do a print(df)which reads nicely within the terminal.

我最终使用了 vscode Python:Terminal (external),并且在调试环境中,我可以print(df)在终端中很好地读取。