np.savetxt No download file CSV(Jupyter Notebook)

Asked

Viewed 59 times

0

I developed a code to help me analyze data faster than I’ve been doing before. All the development was adapted to Jupyter Notebook used in Google Chrome, this because the company I work does not allow me to install any terminal on my notebook unfortunately.

The description of my code is as follows::

Import database from github

import pandas as pd
import numpy as np

database_goodshipped = pd.read_csv("https://raw.githubusercontent.com/CaiqueBarrreto/agroci/main/column2.csv")

Data processing by np.Where


database_goodshipped['variavel_resposta'] = np.where(database_goodshipped['Goods Shipped'].str.contains('FLUTRIAFOL'), 'FLUTRIAFOL',
                                                     (np.where(database_goodshipped['Goods Shipped'].str.contains('CARBENDAZIM'), 'CARBENDAZIM', 'NID')))

Attempt to turn my treated base into a . csv file


b = np.savetxt('myfile.csv', database_goodshipped, delimiter = ",", fmt = '%s')

a = open('myfile.csv', 'r')

print(a.read())

In this case, the error that is returned to me is the following: inserir a descrição da imagem aqui

As I described, the intention is to download my base in csv after treating it with numpy; in this case, I did not understand if this error is because the Jupyter Notebook in the browser version does not allow me to do this type of command or if my code is wrong. In fact, I’ve never heard of Donwloads made by this type of terminal, but it doesn’t hurt to try, right?! hahaha

Thank you

  • Goes in the file jupyter_notebook_config.py and configure the input NotebookApp.iopub_data_rate_limit or start the notebook with the parameter set jupyter --NotebookApp.iopub_data_rate_limit=<coloque_aqui_o_valor_desejado>

  • Augusto, thank you for the information. But how to do this in practice?

  • On the command line type jupyter notebook --NotebookApp.iopub_data_rate_limit=1000000000 or other value

  • Augusto, I tried to do according to but only the "invalid syntax". Any memory adjustment I try to do is giving this, actually. Will the browser this is allowed?

  • is in the google colab?

  • actually was by Jupyter Lab. I tried to do by google colab as you suggested but also gives the same error

  • @Augustovasques, I have no great need to print the final file, just really wanted to follow up with the download. Have any suggestions, in case?

  • Is that I spoke to you either by the command line (DOS, Powershell, Bash, ZSH... or any shell that uses) Initializing the notebook with jupyter notebook --NotebookApp.iopub_data_rate_limit=1000000000 or go to the folder where Jupyter Notebook is installed and edit the file jupyter_notebook_config.py and on the line where you have written NotebookApp.iopub_data_rate_limit=1000000 increase the value NotebookApp.iopub_data_rate_limit=1000000000. If your notebook still doesn’t have the configuration file type in the command line jupyter notebook --generate-config

  • Thank you very much!!! It worked here!

Show 4 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.