Giter Club home page Giter Club logo

covidmx's People

Contributors

azulgarza avatar garciaguevara avatar isccarrasco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

covidmx's Issues

Error encoding='UTF-8'

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.

Fails when installing in windows

I was trying to update the last release to date version 0.3.0 and I got this error when installing:

A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Error in dge.py file

When running Python to get information through the get_data method of the CovidMX object, it returns the following error:

raceback (most recent call last):
File "c:/Users/Alejandro Rebollo/Documents/Covid19MX.py", line 4, in
raw_dge_data = CovidMX(clean=False).get_data()
File "C:\Users\Alejandro Rebollo\AppData\Local\Programs\Python\Python38-32\lib\site-packages\covidmx\dge.py", line 33, in get_data
df, catalogo, descripcion = self.read_data()
File "C:\Users\Alejandro Rebollo\AppData\Local\Programs\Python\Python38-32\lib\site-packages\covidmx\dge.py", line 59, in read_data
raise RuntimeError('Cannot read data description.')
RuntimeError: Cannot read data description.

Catalogos missing

When I am calling this line

covid_dge_data = CovidMX().get_data()

I have this error:

"There is no item named 'Catalogos_0412.xlsx' in the archive"

unexpected keyword argument 'return_catalogo' / 'return_descripcion'

Hi,

when I run covid_dge_data, catalogo_data = CovidMX(return_catalogo=True).get_data() get:

Traceback (most recent call last) <ipython-input-8-9c05e955ccf6> in <module>() 3 covid_dge_data = CovidMX().get_data() 4 raw_dge_data = CovidMX(clean=False).get_data() ----> 5 covid_dge_data, catalogo_data = CovidMX(return_catalogo=True).get_data() 6 covid_dge_data, descripcion_data = CovidMX(return_descripcion=True).get_data() 7 covid_dge_data, catalogo_data, descripcion_data = CovidMX(return_catalogo=True, return_descripcion=True).get_data() /usr/local/lib/python3.6/dist-packages/covidmx/covidmx.py in CovidMX(source, **kwargs) 27 28 if source == "Serendipia": ---> 29 return Serendipia(**kwargs) TypeError: __init__() got an unexpected keyword argument 'return_catalogo'

and covid_dge_data, descripcion_data = CovidMX(return_descripcion=True).get_data() get:

Traceback (most recent call last) <ipython-input-22-1b8abfd4e7ee> in <module>() 4 #raw_dge_data = CovidMX(clean=False).get_data() 5 #covid_dge_data, catalogo_data = CovidMX(return_catalogo=True).get_data() ----> 6 covid_dge_data, descripcion_data = CovidMX(return_descripcion=True).get_data() 7 #covid_dge_data, catalogo_data, descripcion_data = CovidMX(return_catalogo=True, return_descripcion=True).get_data() /usr/local/lib/python3.6/dist-packages/covidmx/covidmx.py in CovidMX(source, **kwargs) 27 28 if source == "Serendipia": ---> 29 return Serendipia(**kwargs) TypeError: __init__() got an unexpected keyword argument 'return_descripcion'

By the way, Unidecode package is required, so could be usefull to add this line to install instructions:

pip install unidecode

Cannot read the data

I'm trying to run the covid_dge_data = CovidMX().get_data() line, but it get the runtime error Cannot read the data. Also get the following: URLError: <urlopen error [Errno 60] Operation timed out>.

Captura de Pantalla 2020-08-04 a la(s) 10 29 37
Captura de Pantalla 2020-08-04 a la(s) 10 29 50

I've failed to pull request at the dge.py file to change the URL_DESCRIPTION and URL_HISTORICALfor the updated ones:

URL_DESCRIPTION = 'http://epidemiologia.salud.gob.mx/gobmx/salud/datos_abiertos/diccionario_datos_covid19.zip' URL_HISTORICAL = 'http://epidemiologia.salud.gob.mx/gobmx/salud/datos_abiertos/datos_abiertos_covid19.zip'

KeyError: 'HABLA_LENGUA_INDIG'

Hi! I'm running the following command:
covid_dge_data, catalogo_data, descripcion_data = CovidMX(return_catalogo=True, return_descripcion=True).get_data()
And I am getting the following error:

KeyError Traceback (most recent call last)
in
3 #covid_dge_data, catalogo_data = CovidMX(return_catalogo=True).get_data()
4 #covid_dge_data, descripcion_data = CovidMX(return_descripcion=True).get_data()
----> 5 covid_dge_data, catalogo_data, descripcion_data = CovidMX(return_catalogo=True, return_descripcion=True).get_data()

~\AppData\Local\Continuum\anaconda3\lib\site-packages\covidmx\dge.py in get_data(self)
36 if self.clean:
37 print('Cleaning data')
---> 38 df = self.clean_data(df, catalogo, descripcion)
39
40 print('Ready!')

~\AppData\Local\Continuum\anaconda3\lib\site-packages\covidmx\dge.py in clean_data(self, df, catalogo, descripcion)
172 for col in df.columns:
173 df[col] = self.replace_values(
--> 174 df, col, desc_dict, catalogo_dict)
175
176

~\AppData\Local\Continuum\anaconda3\lib\site-packages\covidmx\dge.py in replace_values(self, data, col_name, desc_dict, catalogo_dict)
130 def replace_values(self, data, col_name, desc_dict, catalogo_dict):
131
--> 132 formato = desc_dict[col_name]
133 if 'FECHA' in col_name:
134 return pd.to_datetime(

KeyError: 'HABLA_LENGUA_INDIG'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.