Previously the default for the `keepdims` parameter was True, but as of SciPy 1.11.0 it is false. This is actually the behavior we want here since we only care about the mode value and not other values. https://docs.scipy.org/doc/scipy/release/1.11.0-notes.html#expired-deprecations