如何在Jupyter Notebook中更改工作目录? [英] How to change working directory in Jupyter Notebook?

查看:468
本文介绍了如何在Jupyter Notebook中更改工作目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到在Jupyter Notebook中更改工作目录的位置,因此无法使用pd.read_csv方法读取特定的csv文档.

I couldn't find a place for me to change the working directory in Jupyter Notebook, so I couldn't use the pd.read_csv method to read in a specific csv document.

有没有办法做到这一点?仅供参考,我目前正在使用Python3.5.1.

Is there any way to make it? FYI, I'm using Python3.5.1 currently.

谢谢!

推荐答案

运行os.chdir(NEW_PATH)将更改工作目录.

import os
os.getcwd()
Out[2]:
'/tmp'
In [3]:

os.chdir('/')
In [4]:


os.getcwd()
Out[4]:
'/'
In [ ]:

这篇关于如何在Jupyter Notebook中更改工作目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆