We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6141281 commit 3dba073Copy full SHA for 3dba073
1 file changed
scdata/tools/series.py
@@ -1,9 +1,10 @@
1
from scdata.tools.custom_logger import logger
2
3
+from typing import Optional
4
from pandas import Series, Timedelta
5
import numpy as np
6
-def infer_sampling_rate(series: Series) -> int | None:
7
+def infer_sampling_rate(series: Series) -> Optional[int]:
8
'''Infer the sampling rate of the given timeseries, rounded to the
9
closest minute.
10
'''
@@ -21,7 +22,7 @@ def infer_sampling_rate(series: Series) -> int | None:
21
22
return integer_minutes
23
24
-def mode_ratio(series: Series, ignore_zeroes=True) -> int:
25
+def mode_ratio(series: Series, ignore_zeroes=True) -> float:
26
'''Count the percentage of times the most common value appears in the series,
27
ignoring zeroes and NaNs.'''
28
0 commit comments