Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Download data from a jupyter server

I'm using ipython notebook by connecting to a server I don't know how to download a thing (data frame, .csv file,... for example) programatically to my local computer. Because I can't specific declare the path like C://user//... It will be downloaded to their machine not mine

like image 750
Anh Vũ Nguyễn Avatar asked Jan 13 '17 04:01

Anh Vũ Nguyễn


People also ask

How do I download only the output from a Jupyter notebook?

The Jupyter Notebook has an option to export the notebook to many formats. It can be accessed by clicking File -> Download as -> PDF via LaTeX (or PDF via HTML - not visible in the screenshot). This approach requires you to install some additional packages.

How do I download from Jupyter lab?

You can download individual files from the file navigator (which you can get to by clicking on the Jupyter icon in the top left corner). You just need to click the checkbox next to the file you want to download and then click the "download" button at the top of the pane.


2 Answers

Run this in separate cell in one of the notebooks:

!tar cvfz zipname.tar.gz * 

To cover more folders up the tree, write ../ before the * for every step up the directory.

tar cvfz zipname.tar.gz ../../* 

The file zipname.tar.gz will be saved in the same folder as your notebook.

Also if files size is too large execute the following in same notebook block

!split -b 200m allfiles.tar.gz allfiles.tar.gz.part 

Alternatively you can use this extension https://github.com/data-8/nbzip

like image 83
Sagar Dhungel Avatar answered Sep 17 '22 01:09

Sagar Dhungel


If you are using Jupyter notebook, you can go to the "File" tab on the top left part of the notebook and click "Open". It shows you the content of the current directory. You can select your data file with different format (CSV, text, etc) and then you can download it in your local computer.

Open tab in Jupyter notebook

enter image description here

Download your desired file

enter image description here

like image 42
abutaleb haidary Avatar answered Sep 18 '22 01:09

abutaleb haidary