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: `scipy.stats.skew` no longer returns 0 on constant input

See original GitHub issue

Describe your issue.

The documentation of scipy.stats.skew states

Returns: skewness ndarray The skewness of values along an axis, returning 0 where all values are equal.

However, while this used to be the case for scipy < 1.9, it is no longer the case for scipy 1.9.

Reproducing Code Example

In [1]: import scipy

In [2]: scipy.stats.skew([0, 0])

Error message

Out[2]: nan

Expected Outcome

Out[2]: 0.0

SciPy/NumPy/Python version information

1.9.0 1.23.1 sys.version_info(major=3, minor=8, micro=5, releaselevel=‘final’, serial=0)

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tupuicommented, Aug 4, 2022

We usually don’t update the changelog during PR development but when we do create a release (we keep a wiki page for that but for backporting there are only a few items to look at so not needed and we address manually).

0reactions
mfeurercommented, Aug 4, 2022

Just checking, this means that this change will not be featured in the changelog?

Read more comments on GitHub >

github_iconTop Results From Across the Web

scipy.stats.skew — SciPy v1.9.3 Manual
For unimodal continuous distributions, a skewness value greater than zero means that there is more weight in the right tail of the distribution....
Read more >
scipy.stats.skew doesn't work correctly for float point numbers
Compute the sample skewness of a data set. For normally distributed data, the skewness should be about 0. For. unimodal continuous ...
Read more >
SciPy 1.7.0 Release Notes
Before upgrading, we recommend that users check that their own code does not use deprecated SciPy functionality (to do so, run your code...
Read more >
scipy.stats.stats — Elephant 0.7.0 documentation
Use masked arrays to ignore any non-finite values in the input or that arise in the ... If there is more than one...
Read more >
scipy stats.skew() | Python
skewness < 0 : more weight in the right tail of the distribution. Its formula –. Parameters : array : Input array or...
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