Skip to content

Commit 523ef28

Browse files
fix downcasting warning
1 parent 1670fc6 commit 523ef28

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rdtools/utilities.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)