File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def robust_quantile(x, q):
2121 The q-th quantile of x, ignoring small values and NaN's.
2222 """
2323
24- small = x .fillna (0 ).quantile (q ) / 1000
24+ small = x .astype ( float ). fillna (0 ).quantile (q ) / 1000
2525 q = x [x > small ].quantile (q )
2626
2727 return q
@@ -47,7 +47,7 @@ def robust_median(x, q=0.99):
4747 The q-th quantile of x, ignoring small values and NaN's.
4848 """
4949
50- small = x .fillna (0 ).quantile (q ) / 1000
50+ small = x .astype ( float ). fillna (0 ).quantile (q ) / 1000
5151 mdn = x [x > small ].median ()
5252
5353 return mdn
@@ -73,7 +73,7 @@ def robust_mean(x, q=0.99):
7373 The q-th quantile of x, ignoring small values and NaN's.
7474 """
7575
76- small = x .fillna (0 ).quantile (q ) / 1000
76+ small = x .astype ( float ). fillna (0 ).quantile (q ) / 1000
7777 m = x [x > small ].mean ()
7878
7979 return m
You can’t perform that action at this time.
0 commit comments