Skip to content

Commit

Permalink
Aggregate - Adapt to different behaviour of stats.mode (keepdims=Fals…
Browse files Browse the repository at this point in the history
…e by default now)
  • Loading branch information
PrimozGodec committed Aug 24, 2023
1 parent 97c25a9 commit a2408b0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions orangecontrib/timeseries/aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ def windowed_cumprod(x, width, shift):

def windowed_mode(x, width, shift):
modes, counts = windowed_func(
partial(stats.mode, nan_policy='omit'),
# keepdims argument can be removed when we require scipy>=1.11
partial(stats.mode, nan_policy='omit', keepdims=False),
x, width, shift)
modes = modes[:, 0]
if np.ma.isMaskedArray(modes):
# If counts == 0, all values were nan
modes = modes.data
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
'pandas', # statsmodels requires this but doesn't have it in dependencies?
'pandas_datareader',
'numpy',
'scipy>=0.17',
'scipy>=1.9',
'more-itertools',
# required to get current timezone
# adding it does not hurt, Pandas have it as a dependency
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ deps =
# orange3 requires the following
oldest: orange-widget-base==4.18.0
oldest: orange-canvas-core==0.1.27
oldest: scipy==1.9.0
latest: https://github.com/biolab/orange3/archive/refs/heads/master.zip#egg=orange3
latest: https://github.com/biolab/orange-canvas-core/archive/refs/heads/master.zip#egg=orange-canvas-core
latest: https://github.com/biolab/orange-widget-base/archive/refs/heads/master.zip#egg=orange-widget-base
Expand Down

0 comments on commit a2408b0

Please sign in to comment.