File tree Expand file tree Collapse file tree 2 files changed +69
-80
lines changed
Expand file tree Collapse file tree 2 files changed +69
-80
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ def test_mackwolfe(
8888 return (np .nan , np .nan )
8989
9090 Rij = x [_val_col ].rank ()
91- n = cast (Series , x .groupby (_group_col , observed = False )[_val_col ].count ())
91+ n = cast (Series , x .groupby (_group_col , observed = True )[_val_col ].count ())
9292
9393 def _fn (Ri , Rj ):
9494 return np .sum (Ri .apply (lambda x : Rj [Rj > x ].size ))
@@ -235,7 +235,7 @@ def test_osrt(
235235
236236 x .sort_values (by = [_group_col ], ascending = True , inplace = True )
237237 groups = np .unique (x [_group_col ])
238- x_grouped = x .groupby (_group_col , observed = False )[_val_col ]
238+ x_grouped = x .groupby (_group_col , observed = True )[_val_col ]
239239
240240 xi = x_grouped .mean ()
241241 ni = x_grouped .count ()
@@ -360,8 +360,8 @@ def test_durbin(
360360 r = float (b )
361361 k = float (t )
362362
363- x ["y_ranks" ] = x .groupby (_block_id_col )[_y_col ].rank ()
364- rs = x .groupby (_group_col )["y_ranks" ].sum ().to_numpy ()
363+ x ["y_ranks" ] = x .groupby (_block_id_col , observed = True )[_y_col ].rank ()
364+ rs = x .groupby (_group_col , observed = True )["y_ranks" ].sum ().to_numpy ()
365365
366366 A = float (np .sum (x ["y_ranks" ] ** 2.0 ))
367367 C = float (b * k * (k + 1 ) ** 2.0 ) / 4.0
You can’t perform that action at this time.
0 commit comments