DOC: keepdims in stats.mode is incorrectly documented
See original GitHub issueDescribe your issue.
The documentation is missing a … versionadded tag and the argument order is incorrect (shoudl be 4 not 3).
Reproducing Code Example
https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mode.html
Error message
No error, but hard to work with since it produces visible warnings now but no hint as to backward compat.
SciPy/NumPy/Python version information
1.9.2
Issue Analytics
- State:
- Created a year ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
BUG: breaking change: scipy.stats.mode returned value has ...
A keepdims parameter was added to mitigate the change, but the default is currently False . The change will be documented in the...
Read more >Numpy sum() got an 'keepdims' error - python - Stack Overflow
So it states here that if you're using a sub-class of numpy.ndarray , then you'll get this error if the corresponding sum function...
Read more >scipy.stats.mode — SciPy v1.9.3 Manual
In SciPy 1.11.0, this behavior will change: the default value of keepdims will become False , the axis over which the statistic is...
Read more >Mailman 3 ANN: SciPy 1.9.0 - NumPy-Discussion - python.org
- Unlike other reduction functions, ``stats.mode`` didn't consume the axis being operated on and failed for negative axis inputs. Both the bugs have...
Read more >SciPy 1.8.0 Release Notes
#14189: Incorrect shape handling in `scipy.stat.multivariate_t.rvs`… #14190: Links in documentation of Dirichlet distribution are a mess. #14193: Implementation ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Lakshayainani we don’t assign issues, it’s enough to say you are working on it here.
The parameters should be ordered in teh docstring like they are in the function. Currently keeddims is 3 and nan_policy is 4.
See https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mode.html
Also, the rst direction … versionadded: 1.9.0 should be added to the keepdims parameter. Search through the repo for versionadded. You’lll see many examples.