问题描述
如果我有一个通过 Jupyter Notebook 运行的内核,我可以使用 Options > 从 Spyder 轻松连接到它.连接到现有内核 >浏览
.现在我可以通过运行 df
来访问 Jupyter 内核并查看数据帧或任何其他变量:
If I've got a kernel running through a Jupyter Notebook, I can easily connect to it from Spyder using Options > Connect to an exisisting kernel > Browse
. Now I can get access to the Jupyter kernel and view the dataframe or any other variable by just running df
:
Jupyter 代码段:
#imports
import numpy as np
import pandas as pd
# Some sample data
np.random.seed(1234)
df = pd.DataFrame({'A1':np.random.normal(10, 1, 8),
'B1':np.random.normal(20, 2, 8)})
Spyder 代码段:
df
# output:
A1 B1
0 10.471435 20.031393
1 8.809024 15.514630
2 11.432707 22.300071
3 9.687348 21.983892
4 9.279411 21.906648
5 10.887163 15.957490
6 10.859588 19.331845
7 9.363476 20.004237
但是为什么数据框在 Spyder 的 Variable Explorer
中不可用?
推荐答案
(Spyder 维护者这里) 发生这种情况是因为笔记本创建的内核没有显示其所需的功能变量资源管理器中的命名空间.
(Spyder maintainer here) This happens because the kernels that are created by the notebook doesn't have the functionality necessary to display its namespace in our Variable Explorer.
抱歉,目前没有简单的解决方法.
And there's no easy workaround for that at the moment, sorry.
这篇关于如何连接到现有的 Jupyter Notebook 内核并使用变量资源管理器检查变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!