How to open local file on Jupyter?

前端 未结 9 1635
星月不相逢
星月不相逢 2020-12-10 13:08

In[1]:

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

Out[1]:

FileNotFoundError                         Tr         


        
相关标签:
9条回答
  • 2020-12-10 13:40

    Install jupyter. Open terminal. Go to folder where you file is (in terminal ie.cd path/to/folder). Run jupyter notebook. And voila: you have something like this:

    Notice that to open a notebook in the folder, you can either click on it in the browser or go to address:

    http://localhost:8888/notebooks/name_of_your_file.ipynb
    
    0 讨论(0)
  • 2020-12-10 13:40

    To start Jupyter Notebook in Windows:

    • open a Windows cmd (win + R and return cmd)
    • change directory to the desired file path (cd file-path)
    • give command jupyter notebook

    You can further navigate from the UI of Jupyter notebook after you launch it (if you are not directly launching the right file.)
    OR you can directly drag and drop the file to the cmd, to open the file.

    C:\Users\kushalatreya>jupyter notebook "C:\Users\kushalatreya\Downloads\Material\PythonCourseFolder\PythonCourse-DataTypes.ipynb"
    
    0 讨论(0)
  • 2020-12-10 13:41

    Are you running this on Windows or Linux? If you're on Windows,then you should be use a path like C:\\Users\\apple\\Downloads\train.csv . If you're on Linux, then you can follow the same path.

    0 讨论(0)
提交回复
热议问题