Loading data from jupyter server

I use ipython notebook, connecting to the server I don’t know how to upload a thing (data frame, CSV file, ... for example) programmatically to my local computer. Because I cannot specifically declare a path as C: // user // ... It will not be downloaded to my machine

+9
source share
4 answers

If you are using a Jupyter laptop, you can go to the “File” tab at the top left of the laptop and click “Open.” It shows the contents of the current directory. You can select a data file in a different format (CSV, text, etc.), and then download it to your local computer.

Open tab in Jupyter laptop

enter image description here

Download desired file

enter image description here

+8
source

Run this in a separate cell in one of the notebooks:

!tar cvfz zipname.tar.gz * 

To span more folders up the tree, write ../ before * for each step up the directory.

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

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

Also, if the file size is too large, follow these steps in the same block of notepad

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

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

+7
source

Download options for me are not displayed.

The solution was to open the file (which could not be read correctly, since it was a binary file) and load it from the notebook.

+6
source

As explained in another answer , the following code will provide you with a link to download the CSV file in your browser:

 from IPython.display import FileLink, FileLinks df.to_csv('df.csv', index=False) FileLink('df.csv') 
0
source

Source: https://habr.com/ru/post/1262717/


All Articles