AzulGarza / covidmx

Python API to get information about COVID-19 in México.
MIT License
19 stars 7 forks source link

Error encoding='UTF-8' #10

Closed alanponce closed 4 years ago

alanponce commented 4 years ago

covid_dge_data = CovidMX().get_data()

data = pd.read_csv(url_data, encoding='UTF-8') 73 except BaseException: ---> 74 raise RuntimeError('Cannot read the data.') 75 76 try:

RuntimeError: Cannot read the data.

AlexanderBV1 commented 4 years ago

Changing the encoding to 'LATIN-1' fixes this issue but i'm unaware if that changes anything relevant inside the information. I haven't seen anything yet but it is a possibility.

isccarrasco commented 4 years ago

I have added the validation for avoiding this issue in the open PR, yes, the latin encoding solves the issue, but it seems that it is only for some of the csv files, the source is not consistent in the encoding I think.

AzulGarza commented 4 years ago

Thank you! I will prepare the next release considering this change.

liubaoryol commented 4 years ago

Changing the encoding to 'LATIN-1' fixes this issue but i'm unaware if that changes anything relevant inside the information. I haven't seen anything yet but it is a possibility.

How do you change the encoding? I still have this encoding issue with the Dirección General de Epidemiología source.

AzulGarza commented 4 years ago

The version 0.3.0 includes this fix. You can upgrade with pip install --upgrade covidmx. Let me know if you have any problem.