@@ -166,12 +166,6 @@ def test_bin_and_group_dataframe_expected_power():
166
166
df_ ["pow_001_mean" ].to_numpy (), np .array ([15.0 , 25.0 , 15.0 , np .nan , 10.0 , 10.0 ])
167
167
)
168
168
169
- with pl .Config (tbl_cols = - 1 ):
170
- print (df_ )
171
-
172
- np .testing .assert_array_equal (
173
- df_ ["pow_000_var" ].to_numpy (), np .array ([50.0 , 0.0 , np .nan , 0.0 , np .nan , 0.0 ])
174
- )
175
169
np .testing .assert_array_equal (df_ ["pow_000_count" ].to_numpy (), np .array ([2 , 2 , 1 , 2 , 1 , 2 ]))
176
170
np .testing .assert_array_equal (df_ ["pow_001_count" ].to_numpy (), np .array ([2 , 2 , 2 , 0 , 1 , 2 ]))
177
171
@@ -217,8 +211,6 @@ def test_synchronize_nulls():
217
211
"df_name" : ["hypothetical" ],
218
212
"pow_000_mean" : [np .nan ],
219
213
"pow_001_mean" : [np .nan ],
220
- "pow_000_var" : [np .nan ],
221
- "pow_001_var" : [np .nan ],
222
214
"pow_000_count" : [1 ],
223
215
"pow_001_count" : [1 ],
224
216
"count" : [1 ],
@@ -429,14 +421,10 @@ def test_cov_against_var():
429
421
bin_cols_with_df_name = ["wd_bin" , "ws_bin" , "df_name" ],
430
422
)
431
423
432
- df_bin = _bin_and_group_dataframe_expected_power (
433
- df_ = test_df ,
434
- test_cols = ["pow_000" ],
435
- )
424
+ # Manually compute the variance of the pow_000 column
425
+ man_var = test_df ["pow_000" ].var ()
436
426
437
- np .testing .assert_almost_equal (
438
- df_cov ["cov_pow_000_pow_000" ].to_numpy (), df_bin ["pow_000_var" ].to_numpy ()
439
- )
427
+ np .testing .assert_almost_equal (df_cov ["cov_pow_000_pow_000" ].to_numpy (), man_var )
440
428
441
429
442
430
def test_fill_cov_with_var_dont_fill_all ():
0 commit comments