python - Python 魔术命令 %store 在 Google Colab 笔记本上不起作用
问题描述
我正在尝试在两个不同的 Google Colab 笔记本之间共享数据。
谷歌 Colab 笔记本 1:
(...)
data_structure = scaler.fit_transform(features)
%store data_structure
谷歌 Colab 笔记本 2:
%store -r data_structure
print(data_structure)
运行 Notebook 1 后,我收到消息:Stored 'data_structure' (ndarray)。但是,当我运行 Notebook 2 时,我收到消息 error: no stored variable data_structure ... NameError: name 'data_structure' is not defined。
由于笔记本位于不同的目录中,因此我也尝试在同一目录中运行它们。但是,我遇到了同样的问题。
有人可以帮忙吗?
解决方案
推荐阅读
- java - 使用 Regex 从大型文本输入文件中提取 json 对象
- python - # 字符串方法 TypeError: 列在 pyspark 中不可迭代
- java - 如何创建一个数组列表
使用数组 ? - r - R闪亮的登陆页面
- python - 如何使用 django.test.TestCase 断言异常?
- python - 如何从列表列表中识别出现的坐标(x,y)并将其放入数据框中
- reactjs - React Canvas 图像未正确异或
- git - 可以在 Jenkins Pipeline 中提取 $BRANCH_NAME 字符串的一部分吗?
- java - 数组方法抛出类预期错误
- python - 如何从“for”中只获得一个输出