Skip to content

Conversation

@chinandrew
Copy link
Collaborator

Realized R and Python are flipped.

in the below examples, note the 3/1 value.

R:

> aggregated = aggregate_signals(list(cases, deaths), dt=list(0,2))
> head(aggregated[order(aggregated$time_value), ])
    geo_value time_value value+0:jhu-csse_confirmed_incidence_prop value+2:jhu-csse_deaths_incidence_prop
213        us 2020-03-01                                 0.0021064                              0.0003009
214        us 2020-03-02                                 0.0069211                              0.0012037
215        us 2020-03-03                                 0.0060184                              0.0003009
216        us 2020-03-04                                 0.0099303                              0.0006018
217        us 2020-03-05                                 0.0231708                              0.0009028
218        us 2020-03-06                                 0.0159487                              0.0012037
> tail(aggregated[order(aggregated$time_value), ])
    geo_value time_value value+0:jhu-csse_confirmed_incidence_prop value+2:jhu-csse_deaths_incidence_prop
130        us 2020-12-27                                  46.82903                              1.0920353
120        us 2020-12-28                                  52.49864                              1.1218263
121        us 2020-12-29                                  60.24400                              1.0375690
122        us 2020-12-30                                  70.28838                              0.6481797
123        us 2020-12-31                                  70.91068                                     NA
131        us 2021-01-01                                  46.22809                                     NA

Python pre-PR:

In [27]: covidcast.aggregate_signals([cases, deaths], dt=[0,2])[['geo_value', 'time_value', 'jhu-csse_confirmed_incidence_prop_0_value', 'jhu-csse_deaths_incidence_prop_1_value']].head()     
Out[27]: 
  geo_value time_value  jhu-csse_confirmed_incidence_prop_0_value  jhu-csse_deaths_incidence_prop_1_value
0        us 2020-03-01                                   0.002106                                     NaN
1        us 2020-03-02                                   0.006921                                     NaN
2        us 2020-03-03                                   0.006018                                0.000000
3        us 2020-03-04                                   0.009930                                0.001505
4        us 2020-03-05                                   0.023171                                0.000301


In [28]: covidcast.aggregate_signals([cases, deaths], dt=[0,2])[['geo_value', 'time_value', 'jhu-csse_confirmed_incidence_prop_0_value', 'jhu-csse_deaths_incidence_prop_1_value']].tail()     
Out[28]: 
    geo_value time_value  jhu-csse_confirmed_incidence_prop_0_value  jhu-csse_deaths_incidence_prop_1_value
304        us 2020-12-30                                  70.288376                                0.601838
305        us 2020-12-31                                  70.910676                                1.092035
306        us 2021-01-01                                  46.228090                                1.121826
307        us 2021-01-02                                        NaN                                1.037569
308        us 2021-01-03                                        NaN                                0.648180


Python with this PR:

In [5]: covidcast.aggregate_signals([cases, deaths], dt=[0,2])[['geo_value', 'time_value', 'jhu-csse_confirmed_incidence_prop_0_value', 'jhu-csse_deat
   ...: hs_incidence_prop_1_value']].head()                                                                                                           
Out[5]: 
  geo_value time_value  jhu-csse_confirmed_incidence_prop_0_value  jhu-csse_deaths_incidence_prop_1_value
0        us 2020-02-28                                        NaN                                0.000000
1        us 2020-02-29                                        NaN                                0.001505
2        us 2020-03-01                                   0.002106                                0.000301
3        us 2020-03-02                                   0.006921                                0.001204
4        us 2020-03-03                                   0.006018                                0.000301

In [6]: covidcast.aggregate_signals([cases, deaths], dt=[0,2])[['geo_value', 'time_value', 'jhu-csse_confirmed_incidence_prop_0_value', 'jhu-csse_deat
   ...: hs_incidence_prop_1_value']].tail()                                                                                                           
Out[6]: 
    geo_value time_value  jhu-csse_confirmed_incidence_prop_0_value  jhu-csse_deaths_incidence_prop_1_value
304        us 2020-12-28                                  52.498642                                1.121826
305        us 2020-12-29                                  60.243998                                1.037569
306        us 2020-12-30                                  70.288376                                0.648180
307        us 2020-12-31                                  70.910676                                     NaN
308        us 2021-01-01                                  46.228090                                     NaN

@chinandrew chinandrew requested a review from capnrefsmmat April 14, 2021 00:57
Copy link
Contributor

@capnrefsmmat capnrefsmmat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just one suggested improvement to make your improved docs even more improved

chinandrew and others added 2 commits April 13, 2021 18:17
Co-authored-by: Alex Reinhart <areinhar@stat.cmu.edu>
@dshemetov
Copy link
Collaborator

While this looks like the direction @capnrefsmmat @chinandrew were happy to move a couple years ago, this would break a lot of downstream code today, as it's a backwards-incompatible change. Motion to close this PR?

@capnrefsmmat
Copy link
Contributor

Agreed -- too late to change it now.

@dshemetov dshemetov deleted the flip-lags branch June 7, 2023 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants