Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open local file on Jupyter?

Tags:

People also ask

How do I open a local file in jupyter notebook?

You can open existing Jupyter Notebook files (. ipynb) in the Jupyter Notebook dashboard by clicking on the name of the file in the dashboard (e.g. filename. ipynb ).

How do I open a TXT file in Jupyter?

open() still works in Jupyter notebooks. Go to here and click on launch binder . The session that spins up lacks pandas and the following code pasted in a notebook still works to make a text file, named demofile. txt , and then read it in using open() .


In[1]:

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

Out[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?