Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG/ENH: stats nan-policy with elementswise function #8669

Open
josef-pkt opened this issue Apr 3, 2018 · 0 comments
Open

BUG/ENH: stats nan-policy with elementswise function #8669

josef-pkt opened this issue Apr 3, 2018 · 0 comments
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.stats

Comments

@josef-pkt
Copy link
Member

josef-pkt commented Apr 3, 2018

Note from @mdhaber: This is a deep issue that is slated to be addressed as part of this project. Before composing a PR related to this issue, please comment below or - even better - consider resolving another open issue!

This is the general case for #8108
#8108 (comment)

currently there is no special handling of nans.

AFAICS, trimming functions trim1, trimboth treat nan as an extreme observation.

Reproducing code example:

>>> stats.zscore([1,1,1,1,1.1, 5, np.nan])
array([ nan,  nan,  nan,  nan,  nan,  nan,  nan])

>>> stats.sigmaclip([1,1,1,1,1.1, 5, np.nan])
<several RuntimeWarning: invalid value encountered in ...>
SigmaclipResult(clipped=array([], dtype=float64), lower=nan, upper=nan)

>>> stats.trimboth([1,1,1,1,1.1, 5, -5, np.nan], 0.25)
array([ 1. ,  1. ,  1. ,  1.1])

@mdhaber mdhaber added the defect A clear bug or issue that prevents SciPy from being installed or used as expected label Mar 16, 2022
@mdhaber mdhaber changed the title BUG/ENH: stats nan-policy with elementswise function with reduce BUG/ENH: stats nan-policy with elementswise function Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.stats
Projects
None yet
Development

No branches or pull requests

2 participants