question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DOC: keepdims in stats.mode is incorrectly documented

See original GitHub issue

Describe 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:closed
  • Created a year ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
tupuicommented, Oct 11, 2022

@Lakshayainani we don’t assign issues, it’s enough to say you are working on it here.

1reaction
bashtagecommented, Oct 11, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found