如何在Jupyter上打开本地文件? [英] How to open local file on Jupyter?

查看:4572
本文介绍了如何在Jupyter上打开本地文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在[1]中:

path='/Users/apple/Downloads/train.csv'
open(path).readline()

出[1]:

FileNotFoundError                         Traceback (most recent call 
last)
<ipython-input-7-7fad5faebc9b> in <module>()
----> 1 open(path).readline()

FileNotFoundError: [Errno 2] No such file or directory: 
'/Users/apple/Downloads/train.csv'

我很困惑.我认为这段代码与许多教程完全相似,并且我确定我的文件在正确的路径中,但是为什么它不起作用?

I'm confused a lot.I thought this code is exactly similar with many tutorials, and I'm sure I have this file in the right path, but why does it not works?

推荐答案

许多教程都说我们应该更改Jupyter的工作流程,但我没有理解.

Many tutorials said that we should change Jupyter's workflow, but I didn't get it.

最后,我找到一种简单的方法:只需将文件拖到此部分即可.

Finally, I find an easy way: Just drags file to this part.

这篇关于如何在Jupyter上打开本地文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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