Skip to content

cov fails with complex data (Trac #2137) #597

Closed

Description

@numpy-gitbot

Original ticket http://projects.scipy.org/numpy/ticket/2137 on 2012-05-20 by trac user mph, assigned to unknown.

The cov function fails with complex data due to line 1990 in function_base.py

X = array(m, ndmin=2, dtype=float)

For example, with
a = np.array(((1, 2, 3),(1j, 2j, 3j)))

np.cov(a) gives

array([[ 1., 0.],
[ 0., 0.]])

whereas the correct answer is

array([[ 1., -1.j],
[ 1.j, 1.]])

Activity

  1. added a commit that references this issue on Oct 8, 2013
    3e5dc27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions