I have been trying to figure out how to get a UTF-8 CSV that I downloaded into a DataFrame. So far I have tried
df = pd.read_csv('myfile.csv', encoding='utf8')
and it gives me garbage. I am having success reading it in with
import csv
with open('some.csv', newline='', encoding='utf-8') as f:
reader = csv.reader(f)
for row in reader:
print(row)
as suggested in this post
Reading a UTF8 CSV file with Python
but it reads in this gigantic file and I cannot get it into a DataFrame.
I'm using python 3. Thanks for helping!
My specific error output is
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 3: invalid start byte'
And the file I am trying to work is one of the YEARLY CSV files downloaded from this link (not WEEKLY, I am not sure if weekly is a different format)
https://exporter.nih.gov/ExPORTER_Catalog.aspx?sid=2&index=0