我在 Spyder 4.1.1 中运行以下代码,但控制台没有显示任何输出:
df.head()
df.shape
Run Code Online (Sandbox Code Playgroud)
以前我有 Spyder 3.7,它可以工作,但现在更新后它不能工作。我尝试重置为默认设置并尝试更改控制台设置,但没有任何效果。如果我使用 print(df.head) 它可以工作,但它应该可以在没有 print() 的情况下工作。
请帮忙。附上截图
尝试在 Ipython 控制台中运行以下命令。
%config InteractiveShell.ast_node_interactivity='last_expr'
Run Code Online (Sandbox Code Playgroud)
这是设置说明:
ZMQInteractiveShell.ast_node_interactivity=<Enum>
Current: 'last_expr'
Choices: ['all', 'last', 'last_expr', 'none', 'last_expr_or_assign']
'all', 'last', 'last_expr' or 'none', 'last_expr_or_assign' specifying which
nodes should be run interactively (displaying output from expressions).
Run Code Online (Sandbox Code Playgroud)