I hereby claim:
- I am adrianulloa on github.
- I am adrianulloa (https://keybase.io/adrianulloa) on keybase.
- I have a public key ASCi7x_SQdai3lsX6RMT2BlAmULAp6EnvwSeDNPJsyXk1Qo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
from datetime import datetime | |
date_format = "%Y%m%d" | |
def dias(x, y): | |
v1 = datetime.strptime(str(x), date_format) | |
v2 = datetime.strptime(str(y), date_format) | |
delta = v1 - v2 | |
return int(delta.days) |
def consolidado(data): | |
def getCosecha(mini, maxi, leni): | |
cosechasIni = {201809: 1, 201810: 2, 201811: 3, 201812: 4} | |
cosechasFin = {201902: 1, 201903: 2, 201904: 3, 201905: 4} | |
if mini in cosechasIni and maxi in cosechasFin and (cosechasIni[mini] == cosechasFin[maxi]) and leni== 6: | |
return cosechasIni[mini] | |
else: | |
return 0 | |
xmax = data.groupby(by = ['ID2']).max().loc[:,'PERIODO'].to_dict() |