Skip to content

Commit 20be8fe

Browse files
committedMay 16, 2023
Update
1 parent 1a83cdf commit 20be8fe

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed
 

‎statistical_methods_library/imputation/engine.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ def calculate_weighted_link(link_name):
450450
["period", "grouping"],
451451
)
452452
)
453-
453+
454454
return df
455455

456456
# Caching for both imputed and unimputed data.

‎statistical_methods_library/imputation/ratio_calculators.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,7 @@ def upper_bound(c):
276276
)
277277

278278
growth_df = df.select(
279-
"ref", "period", "grouping", "link_inclusion_previous", "link_inclusion_next",
280-
"link_inclusion_current", *growth_additional_outputs.keys()
279+
"ref", "period", "grouping", *growth_additional_outputs.keys()
281280
)
282281

283282
return [
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
identifier,date,group,other,growth_forward,growth_backward,forward,backward,construction,unweighted_forward,unweighted_backward,unweighted_construction,output,marker,count_forward,count_backward,count_construction,default_forward,default_backward,default_construction
22
110001,201912,100,89,,,,,,1,1.5274,50.3694,0,BI,,,,,,
3-
110001,202001,100,89,,1.036787797,1,2.09204015,76.03985875,1,2.656680299,101.710317,9244,R,0,4,4,true,false,false
3+
110001,202001,100,89,,1.036787797,1,2.09204015,76.03985875,1,2.65668,101.710317,9244,R,0,4,4,true,false,false
44
110001,202002,100,89,0.964517525,1.43945754,0.885925,1.894176015,88.31349209,0.771850199,1.13167173,74.91666667,8916,R,4,3,4,false,false,false
55
110001,202003,100,89,0.694706146,,0.870040426,1.065836,72.58901516,0.968230653,1,70.26136364,6194,R,3,0,3,false,true,false
6-
110002,202001,100,83,,0.817550398,1,2.09204015,76.03985875,1,2.656680299,101.710317,4826,R,0,4,4,true,false,false
6+
110002,202001,100,83,,0.817550398,1,2.09204015,76.03985875,1,2.65668,101.710317,4826,R,0,4,4,true,false,false
77
110002,202002,100,83,1.223166183,1.244570947,0.885925,1.894176015,88.31349209,0.771850199,1.13167173,74.91666667,5903,R,4,3,4,false,false,false
88
110002,202003,100,83,0.803489751,,0.870040426,1.065836,72.58901516,0.968230653,1,70.26136364,4743,R,3,0,3,false,true,false
9-
110003,202001,100,4,,7.466535433,1,2.09204015,76.03985875,1,2.656680299,101.710317,7586,R,0,4,4,true,false,false
9+
110003,202001,100,4,,7.466535433,1,2.09204015,76.03985875,1,2.65668,101.710317,7586,R,0,4,4,true,false,false
1010
110003,202002,100,4,0.133930925,0.710986704,0.885925,1.894176015,88.31349209,0.771850199,1.13167173,74.91666667,1016,R,4,3,4,false,false,false
1111
110003,202003,100,4,1.406496063,,0.870040426,1.065836,72.58901516,0.968230653,1,70.26136364,1429,R,3,0,3,false,true,false
12-
110004,202001,100,76,,1.305847569,1,2.09204015,76.03985875,1,2.656680299,101.710317,3975,R,0,4,4,true,false,false
12+
110004,202001,100,76,,1.305847569,1,2.09204015,76.03985875,1,2.65668,101.710317,3975,R,0,4,4,true,false,false
1313
110004,202002,100,76,0.765786164,,0.885925,1.894176015,88.31349209,0.771850199,1.13167173,74.91666667,3044,R,4,3,4,false,false,false
1414
110004,202003,100,76,,,0.870040426,1.065836,72.58901516,0.968230653,1,70.26136364,2648.403058,FIR,3,0,3,false,true,false
1515
110005,201912,200,27,,,,,,1,2.994350985,107.48,0,BI,,,,,,
16-
110005,202001,200,27,,0.743586089,1,2.642597676,144.865,1,2.290844366,182.25,5217,R,0,3,3,true,false,false
16+
110005,202001,200,27,,0.743586089,1,2.642597676,144.865,1,2.290844,182.25,5217,R,0,3,3,true,false,false
1717
110005,202002,200,27,1.344834196,0.70583501,0.99724,1.562080758,166.2624046,0.994479964,0.833317149,150.2748092,7016,R,3,4,4,false,false,false
1818
110005,202003,200,27,1.416761688,,1.127130141,0.916659,166.2557252,1.259780318,1,182.2366412,9940,R,4,0,4,false,true,false
19-
110006,202001,200,42,,0.68736285,1,2.642597676,144.865,1,2.290844366,182.25,5325,R,0,3,3,true,false,false
19+
110006,202001,200,42,,0.68736285,1,2.642597676,144.865,1,2.290844,182.25,5325,R,0,3,3,true,false,false
2020
110006,202002,200,42,1.454835681,1.158863126,0.99724,1.562080758,166.2624046,0.994479964,0.833317149,150.2748092,7747,R,3,4,4,false,false,false
2121
110006,202003,200,42,0.862914677,,1.127130141,0.916659,166.2557252,1.259780318,1,182.2366412,6685,R,4,0,4,false,true,false
22-
110007,202001,200,19,,5.441584158,1,2.642597676,144.865,1,2.290844366,182.25,5496,R,0,3,3,true,false,false
22+
110007,202001,200,19,,5.441584158,1,2.642597676,144.865,1,2.290844,182.25,5496,R,0,3,3,true,false,false
2323
110007,202002,200,19,0.183770015,0.817813765,0.99724,1.562080758,166.2624046,0.994479964,0.833317149,150.2748092,1010,R,3,4,4,false,false,false
2424
110007,202003,200,19,1.222772277,,1.127130141,0.916659,166.2557252,1.259780318,1,182.2366412,1235,R,4,0,4,false,true,false
25-
110008,202001,200,43,,,1,2.642597676,144.865,1,2.290844366,182.25,10340.484733,BI,0,3,3,true,false,false
25+
110008,202001,200,43,,,1,2.642597676,144.865,1,2.290844,182.25,10340.484733,BI,0,3,3,true,false,false
2626
110008,202002,200,43,,0.650756694,0.99724,1.562080758,166.2624046,0.994479964,0.833317149,150.2748092,3913,R,3,4,4,false,false,false
2727
110008,202003,200,43,1.53667263,,1.127130141,0.916659,166.2557252,1.259780318,1,182.2366412,6013,R,4,0,4,false,true,false

‎tests/imputation/test_mean_of_ratios.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,7 @@ def test_calculations(fxt_load_test_csv, scenario_type, scenario):
217217
scenario_expected_output = scenario_expected_output.filter(
218218
col(period_col) >= imputation_kwargs["starting_period"]
219219
)
220-
scenario_input.show(100)
221-
back_data_df.show(100)
220+
222221
# We need to drop our grouping and auxiliary columns from our output now
223222
# we've potentially set up our back data as these must not come out of
224223
# imputation.

0 commit comments

Comments
 (0)