Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

nanmean and nanvar raise odd RuntimeWarning #15219

Open
Labels
15 - Discussion62 - Python APIChanges or additions to the Python API. Mailing list should usually be notified.
@admercs

Description

@admercs

nanmean andnanvar raiseRuntimeWarning exceptions that are not called by their non-nan counterpart functions.

Reproducing code example:

importnumpyasnptest=np.zeros((2,3,4))test[:,:,1:2]=np.nannp.mean(test,axis=0)# OKnp.nanmean(test,axis=0)# RuntimeWarning: Mean of empty slicenp.var(test,axis=0)# OKnp.nanvar(test,axis=0)# RuntimeWarning: Degrees of freedom <= 0 for slice.

Error message:

RuntimeWarning: Mean of empty slice
RuntimeWarning: Degrees of freedom <= 0 for slice.

Numpy/Python version information:

1.17.2 3.7.4 (default, Aug 13 2019, 15:17:50) [Clang 4.0.1 (tags/RELEASE_401/final)]

Metadata

Metadata

Assignees

No one assigned

    Labels

    15 - Discussion62 - Python APIChanges or additions to the Python API. Mailing list should usually be notified.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp