Created
August 13, 2021 18:36
-
-
Save alonsosilvaallende/2f0c67348dff00cf0251da6238d29d2d to your computer and use it in GitHub Desktop.
test2_prod89.ipynb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"nbformat": 4, | |
"nbformat_minor": 0, | |
"metadata": { | |
"colab": { | |
"name": "test2_prod89.ipynb", | |
"provenance": [], | |
"collapsed_sections": [], | |
"authorship_tag": "ABX9TyPne6OrDVuxR1Lub+FHY9Rk", | |
"include_colab_link": true | |
}, | |
"kernelspec": { | |
"name": "python3", | |
"display_name": "Python 3" | |
}, | |
"language_info": { | |
"name": "python" | |
} | |
}, | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "view-in-github", | |
"colab_type": "text" | |
}, | |
"source": [ | |
"<a href=\"https://colab.research.google.com/gist/alonsosilvaallende/2f0c67348dff00cf0251da6238d29d2d/test2_prod89.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"metadata": { | |
"id": "EQiMU5RKvhIb" | |
}, | |
"source": [ | |
"import pandas as pd\n", | |
"import datetime" | |
], | |
"execution_count": 1, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"metadata": { | |
"id": "BoIK8_4BvkDH" | |
}, | |
"source": [ | |
"data_raw = pd.read_csv(\"https://raw.githubusercontent.com/MinCiencia/Datos-COVID19/master/output/producto76/vacunacion.csv\")" | |
], | |
"execution_count": 2, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"metadata": { | |
"id": "5hi_2v5owRDd" | |
}, | |
"source": [ | |
"unica = data_raw.iloc[2,2:].reset_index().rename(columns={'index':'fecha', 2:'completa'}).set_index(\"fecha\")" | |
], | |
"execution_count": 3, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"metadata": { | |
"id": "BAoXnef1xCj5" | |
}, | |
"source": [ | |
"unica.index = pd.to_datetime(unica.index)+datetime.timedelta(28)" | |
], | |
"execution_count": 4, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"metadata": { | |
"id": "zZd7bCgzwDcm" | |
}, | |
"source": [ | |
"segunda = data_raw.iloc[1,2:].reset_index().rename(columns={'index':'fecha', 1:'completa'}).set_index(\"fecha\")" | |
], | |
"execution_count": 5, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"metadata": { | |
"id": "hpjq47ulwT-i" | |
}, | |
"source": [ | |
"segunda.index = pd.to_datetime(segunda.index)+datetime.timedelta(14)" | |
], | |
"execution_count": 6, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"metadata": { | |
"id": "0f__6_dQxNlJ" | |
}, | |
"source": [ | |
"completa = segunda.loc[\"2021-01-21\":\"2021-08-26\"]+unica.loc[\"2021-01-21\":\"2021-08-26\"]" | |
], | |
"execution_count": 7, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/", | |
"height": 990 | |
}, | |
"id": "87lzazQlx1Z_", | |
"outputId": "7e71a010-6ada-4822-871e-8c292a5eb0cf" | |
}, | |
"source": [ | |
"completa.loc[\"2021-07-29\":]" | |
], | |
"execution_count": 8, | |
"outputs": [ | |
{ | |
"output_type": "execute_result", | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<style scoped>\n", | |
" .dataframe tbody tr th:only-of-type {\n", | |
" vertical-align: middle;\n", | |
" }\n", | |
"\n", | |
" .dataframe tbody tr th {\n", | |
" vertical-align: top;\n", | |
" }\n", | |
"\n", | |
" .dataframe thead th {\n", | |
" text-align: right;\n", | |
" }\n", | |
"</style>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>completa</th>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>fecha</th>\n", | |
" <th></th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>2021-07-29</th>\n", | |
" <td>1.18464e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-07-30</th>\n", | |
" <td>1.18605e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-07-31</th>\n", | |
" <td>1.18774e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-01</th>\n", | |
" <td>1.1879e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-02</th>\n", | |
" <td>1.19624e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-03</th>\n", | |
" <td>1.20624e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-04</th>\n", | |
" <td>1.21373e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-05</th>\n", | |
" <td>1.21821e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-06</th>\n", | |
" <td>1.22427e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-07</th>\n", | |
" <td>1.22544e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-08</th>\n", | |
" <td>1.22554e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-09</th>\n", | |
" <td>1.22999e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-10</th>\n", | |
" <td>1.23437e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-11</th>\n", | |
" <td>1.2374e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-12</th>\n", | |
" <td>1.24604e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-13</th>\n", | |
" <td>1.25286e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-14</th>\n", | |
" <td>1.25392e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-15</th>\n", | |
" <td>1.25398e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-16</th>\n", | |
" <td>1.25661e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-17</th>\n", | |
" <td>1.25931e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-18</th>\n", | |
" <td>1.26542e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-19</th>\n", | |
" <td>1.26986e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-20</th>\n", | |
" <td>1.27313e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-21</th>\n", | |
" <td>1.27337e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-22</th>\n", | |
" <td>1.27337e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-23</th>\n", | |
" <td>1.27558e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-24</th>\n", | |
" <td>1.2776e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-25</th>\n", | |
" <td>1.28939e+07</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2021-08-26</th>\n", | |
" <td>1.29707e+07</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" completa\n", | |
"fecha \n", | |
"2021-07-29 1.18464e+07\n", | |
"2021-07-30 1.18605e+07\n", | |
"2021-07-31 1.18774e+07\n", | |
"2021-08-01 1.1879e+07\n", | |
"2021-08-02 1.19624e+07\n", | |
"2021-08-03 1.20624e+07\n", | |
"2021-08-04 1.21373e+07\n", | |
"2021-08-05 1.21821e+07\n", | |
"2021-08-06 1.22427e+07\n", | |
"2021-08-07 1.22544e+07\n", | |
"2021-08-08 1.22554e+07\n", | |
"2021-08-09 1.22999e+07\n", | |
"2021-08-10 1.23437e+07\n", | |
"2021-08-11 1.2374e+07\n", | |
"2021-08-12 1.24604e+07\n", | |
"2021-08-13 1.25286e+07\n", | |
"2021-08-14 1.25392e+07\n", | |
"2021-08-15 1.25398e+07\n", | |
"2021-08-16 1.25661e+07\n", | |
"2021-08-17 1.25931e+07\n", | |
"2021-08-18 1.26542e+07\n", | |
"2021-08-19 1.26986e+07\n", | |
"2021-08-20 1.27313e+07\n", | |
"2021-08-21 1.27337e+07\n", | |
"2021-08-22 1.27337e+07\n", | |
"2021-08-23 1.27558e+07\n", | |
"2021-08-24 1.2776e+07\n", | |
"2021-08-25 1.28939e+07\n", | |
"2021-08-26 1.29707e+07" | |
] | |
}, | |
"metadata": { | |
"tags": [] | |
}, | |
"execution_count": 8 | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment