深度阅读

How to switch directories in Jupyter Notebook

作者
作者
2023年08月22日
更新时间
7.48 分钟
阅读时间
0
阅读量

To switch directories in Jupyter Notebook, you can use the %cd magic command. Here’s an example:

%cd /path/to/new/directory

Replace /path/to/new/directory with the full path to the directory you want to switch to. Note that you need to use the full path, not a relative path.

You can also use the !cd command to change the working directory of the shell used by Jupyter Notebook, but this will not change the working directory of the notebook itself. For example:

!cd /path/to/new/directory

This command will change the working directory of the shell, but the notebook will still be in the original directory. To change the working directory of the notebook, you need to use the %cd magic command as shown above.

相关标签

博客作者

热爱技术,乐于分享,持续学习。专注于Web开发、系统架构设计和人工智能领域。