美文网首页
jupyter notebook导入python code

jupyter notebook导入python code

作者: geaus | 来源:发表于2017-08-30 23:41 被阅读0次
  • 本地导入code
    jupyter notebook可以在cell中导入本地文件的py文件,具体方式如下:
    在cell中输入%load test.py,然后执行,则可在当前cell中导入文件中的code。
load_py.png
  • 网络导入code
%load http://url
  • 运行python文件
%run file.py
  • 运行shell命令,方法为shell命令前加!
shell.png
  • 获取当前路径,方法为%pwd
  • 使用matplotlib绘图,可以在开头加%matplotlib inline

相关文章

网友评论

      本文标题:jupyter notebook导入python code

      本文链接:https://www.haomeiwen.com/subject/kkdfjxtx.html