File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -178,10 +178,16 @@ def threadpool_info():
178
178
threadpool_info .__doc__ = threadpoolctl .threadpool_info .__doc__
179
179
180
180
181
- # TODO: Remove when SciPy 1.9 is the minimum supported version
181
+ # TODO: Remove when SciPy 1.11 is the minimum supported version
182
182
def _mode (a , axis = 0 ):
183
183
if sp_version >= parse_version ("1.9.0" ):
184
- return scipy .stats .mode (a , axis = axis , keepdims = True )
184
+ mode = scipy .stats .mode (a , axis = axis , keepdims = True )
185
+ if sp_version >= parse_version ("1.10.999" ):
186
+ # scipy.stats.mode has changed returned array shape with axis=None
187
+ # and keepdims=True, see https://github.com/scipy/scipy/pull/17561
188
+ if axis is None :
189
+ mode = np .ravel (mode )
190
+ return mode
185
191
return scipy .stats .mode (a , axis = axis )
186
192
187
193
You can’t perform that action at this time.
0 commit comments