Tuesday, May 26, 2020

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

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 empty df. Example below:

Empty DataFrame
Columns: [name, date_time, image, place]
Index: []

On Tuesday, May 26, 2020 at 2:23:58 AM UTC+2, J.T. wrote:
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 <lejaha...@gmail.com> 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 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 records to the HTML tags. But however, I keep getting the error below. 


File "pandas\_libs\parsers.pyx", line 532, in pandas._libs.parsers.TextReader.__cinit__
    <source code not available>

Exception Type: EmptyDataError at /upload_reading
Exception Value: No columns to parse from file



How do I fix this?



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/72b3aabd-3930-43ab-821f-e43bc23568e4%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4e0a6361-f3f2-4005-ac2a-627f1b5076dc%40googlegroups.com.

No comments:

Post a Comment