You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
Este repositório não espelha 100% o produtivo (que tem chaves para o deploy e cronjobs). No loft.science agora reportamos uma suavização gaussiana de 14 dias. O seguinte código altera esse comportamento:
defsmooth_new_cases(new_cases):
""" Function to apply gaussian smoothing to cases Arguments ---------- new_cases: time series of new cases Returns ---------- smoothed_cases: cases after gaussian smoothing See also ---------- This code is heavily based on Realtime R0 by Kevin Systrom https://github.com/k-sys/covid-19/blob/master/Realtime%20R0.ipynb """smoothed_cases=new_cases.rolling(14,
win_type='gaussian',
min_periods=1,
#center=True
).mean(std=3).round()
zeros=smoothed_cases.index[smoothed_cases.eq(0)]
iflen(zeros) ==0:
idx_start=0else:
last_zero=zeros.max()
idx_start=smoothed_cases.index.get_loc(last_zero) +1smoothed_cases=smoothed_cases.iloc[idx_start:]
original=new_cases.loc[smoothed_cases.index]
returnoriginal, smoothed_cases
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
No description provided.
The text was updated successfully, but these errors were encountered: