Skip to content

Instantly share code, notes, and snippets.

View rrealrangel's full-sized avatar

Roberto A. Real-Rangel rrealrangel

  • Mexicali, B. C., Mexico
View GitHub Profile
@rrealrangel
rrealrangel / apa7_modified.csl
Last active December 28, 2022 09:07
The APA 7th Ed. CSL style modified to include the original title in brackets after the translated title. This can be used in the opposite: adding in brackets the translated title when the source is in a language different from the document.
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="never" page-range-format="expanded">
<info>
<title>American Psychological Association 7th edition (con "y")</title>
<title-short>APA</title-short>
<id>http://www.zotero.org/styles/apa</id>
<link href="http://www.zotero.org/styles/apa" rel="self"/>
<link href="http://www.zotero.org/styles/apa-6th-edition" rel="template"/>
<link href="https://apastyle.apa.org/style-grammar-guidelines/references/examples" rel="documentation"/>
<author>
@rrealrangel
rrealrangel / cmap_figure
Last active December 11, 2020 01:00
This is the code to make the figure tweeted in https://twitter.com/rrealrangel/status/1336797063724617728. It is product of personal work and originally was not intended to be published, so it is not as clear as it could be with a little more time available. Thanks for your interest. ;)
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 10 16:49:05 2020
@author: rreal
"""
import matplotlib as mpl
import numpy as np
import pandas as pd
BDCN_TS = "C://..." # Full path of observed data CSV input files.
@rrealrangel
rrealrangel / covid19mx_tendencias_bc_lowess.py
Created August 1, 2020 02:13
Estimar la tendencia del número de nuevos casos diarios de COVID-19 en los municipios de Baja California usando los conjuntos de datos de la Base de Datos de COVID-19 de la Dirección General de Epidemiología de la Secretaría de Salud, disponible en https://bit.ly/2XvIsPX.
# -*- coding: utf-8 -*-
"""
GENERAR FIGURAS DE LA EVOLUCIÓN DE CASOS DE COVID-19 EN MÉXICO.
Created on Fri May 22 10:53:26 2020
@author: r.realrangel@gmail.com
"""
from pathlib import Path
import datetime as dt
import numpy as np
# -*- coding: utf-8 -*-
"""
GENERAR FIGURAS DE LA EVOLUCIÓN DE CASOS DE COVID-19 EN MÉXICO.
Created on Fri May 22 10:53:26 2020
@author: r.realrangel@gmail.com
"""
from pathlib import Path
import datetime
import pandas as pd
# -*- coding: utf-8 -*-
"""
GENERAR FIGURAS DE LA EVOLUCIÓN DE DEFUNCIONES POR COVID-19 EN MÉXICO
Con cambios menores, este código puede ser usado para cualquier otro
municipio o estado de interés.
Created on Fri May 22 10:53:26 2020
@author: r.realrangel@gmail.com
"""
@rrealrangel
rrealrangel / covid19mx_hospitalizados_ambulatorios
Last active June 6, 2020 05:13
Rutinas para generar archivos PNG con gráficos de la evolución de los casos diarios hospitalizados y ambulatorios de COVID-19 en México. Usa como fuente de información los archivos diarios de la base de datos de COVID-19 de la Secretaría de Salud (disponibles en https://bit.ly/3dE7ofg).
# -*- coding: utf-8 -*-
"""
GENERAR FIGURAS DE CASOS DIARIOS DE COVID-19 EN MEXICALI, B. C.
POR FECHA DE INGRESO A LA UNIDAD DE ATENCIÓN
Con cambios menores, este código puede ser usado para cualquier otro
municipio o estado de interés.
Created on Jun 05 00:54 2020
@author: r.realrangel@gmail.com
# -*- coding: utf-8 -*-
"""
GENERAR FIGURAS DE LA EVOLUCIÓN DE CASOS DE COVID-19 EN MÉXICO.
Created on Fri May 22 10:53:26 2020
@author: r.realrangel@gmail.com
"""
from datetime import datetime as dt
from pathlib import Path
import datetime