admin管理员组文章数量:1406306
Let say I have two notebooks:
- nba.ipynb
- nbb.ipynb
In notebook A, I try to run: %run -n nbB.ipynb
so that the two notebooks are running in two different namespace. However, after execute %run -n nbB.ipynb
, it still overwrite on my x
, y
variable
Sample code: nba.ipynb
x = 2
y = 100
%store y
%run -n nbb.ipynb
%store -r y # it still update y regardless having this or not
nbb.ipynb
x=3
%store -r y
y += 50
How to fix this?
本文标签: pythonhow to execute notebook in different namespaceStack Overflow
版权声明:本文标题:python - how to execute notebook in different namespace - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745006105a2637272.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论