Re: EmptyDataError at /upload_reading while reading csv file using pandas

2020-05-26 Thread jakote lejaha
The file I had created myself but I have realized that the problem was with the path to the file. Django request.POST['file'] uses an "InMemoryUploadedFile" to handle file upload. And I could not explicitly reference the path of the file from the fileupload input, and parse directly into "pandas.r

Re: EmptyDataError at /upload_reading while reading csv file using pandas

2020-05-26 Thread Jason Turner
Is the csv something you created? Or was it given to you? I use pandas extensively & the times I've received that error, the issue has been with the file itself. Ard there blank line(s) at the top of the file? On Tue, May 26, 2020, 4:11 AM jakote lejaha wrote: > The same very same file works f

Re: EmptyDataError at /upload_reading while reading csv file using pandas

2020-05-26 Thread jakote lejaha
The same very same file works fine for the python "csv.reader" function with the other parameter as (delimiter=",") other than the file itself. I recently added names attribute as a parameter to the "pandas.read_csv" function, but I can still not get my table as expected. Instead, I get an empt

Re: EmptyDataError at /upload_reading while reading csv file using pandas

2020-05-25 Thread Jason Turner
Are you sure the file is coma delimited? This error is usually because the file is not coma separated. On Mon, May 25, 2020, 5:04 PM jakote lejaha wrote: > Ideally I would have wanted to use the "csv.reader" function, but in this > case it becomes complicated as I would like to load the cvs file

EmptyDataError at /upload_reading while reading csv file using pandas

2020-05-25 Thread jakote lejaha
Ideally I would have wanted to use the "csv.reader" function, but in this case it becomes complicated as I would like to load the cvs file to my web template before I decide if I want to save it to the database or not. So I opt for reading the file using pandas as it's easy to display the record