I have a table from here: https://deepnote.com/project/vacunacion-en-Espana-vs-covid-19-UhxqL4bdSfGJjeyb1WDM6A/%2Fnotebook.ipynb. That's a jupyter notebook which downloads every day of vaccination data in Spain and morphs them into different evolution tables. The specific table is this:
Day | admin doses | complete dosis |
---|---|---|
210104 | 82834 | 0 |
210107 | 207323 | 0 |
210108 | 277976 | 0 |
210111 | 406091 | 0 |
210112 | 488041 | 0 |
210113 | 581638 | 0 |
210114 | 676186 | 0 |
210115 | 768950 | 0 |
210118 | 897942 | 4630 |
210119 | 966097 | 18682 |
210120 | 1025937 | 31284 |
210121 | 1103301 | 98112 |
210122 | 1165825 | 136912 |
210125 | 1237593 | 177396 |
210126 | 1291216 | 247394 |
210127 | 1356461 | 346132 |
210128 | 1395618 | 385518 |
210129 | 1474189 | 503732 |
210201 | 1609261 | 715784 |
210202 | 1673054 | 837038 |
210203 | 1764778 | 997956 |
210204 | 1865342 | 1172244 |
210205 | 1988160 | 1365818 |
210208 | 2105033 | 1572814 |
210209 | 2167241 | 1677564 |
210210 | 2233249 | 1779366 |
210211 | 2320507 | 1886556 |
210212 | 2423045 | 2000970 |
210215 | 2561608 | 2140182 |
210216 | 2624512 | 2193844 |
210217 | 2690457 | 2238360 |
210218 | 2782751 | 2289112 |
210219 | 2936011 | 2342052 |
210222 | 3090351 | 2394122 |
210223 | 3165191 | 2416610 |
210224 | 3284678 | 2442366 |
210225 | 3436158 | 2463564 |
210226 | 3605635 | 2487566 |
210301 | 3829465 | 2523696 |
210302 | 3908734 | 2533400 |
210303 | 4059320 | 2574004 |
210304 | 4229092 | 2617826 |
210305 | 4471577 | 2684970 |
210308 | 4712191 | 2766976 |
210309 | 4848648 | 2824472 |
210310 | 4989505 | 2895676 |
210311 | 5172106 | 3006516 |
210312 | 5352767 | 3166488 |
210315 | 5644895 | 3387348 |
210316 | 5742218 | 3457074 |
210317 | 5857085 | 3609230 |
210318 | 5993363 | 3773626 |
210322 | 6321908 | 4221736 |
210323 | 6409196 | 4313196 |
210324 | 6620093 | 4552466 |
And I would like to know what is the nearest value of each complete doses
compared with the entire admin doses
, in order to know how many days were needed for completing a vaccination period. For instance, at 210129 there were 503732 complete doses, and the nearest value is 488041 admin doses at 210112 - thus 17 days passed between the admin of 488041 doses and 503732 doses.
I tried a good number of options, but nothing works either with raw pandas or with pandas and numpy. In Excel it would be
{=INDEX(A$2:A$56;MATCH(MIN(ABS(B$2:B$56-C7));ABS(B$2:B$56-C7);0))}
But I haven't been able to translate it into Pandas
Thanks in advance for any help