8000 numpy.linalg.lstsq gives empty residual · Issue #4438 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
numpy.linalg.lstsq gives empty residual #4438
Closed
@qnzhou

Description

@qnzhou

python version: 2.7.6
numpy version: 1.8.0

Here is a short example:

import numpy as np
from numpy.linalg import lstsq

a = np.array([[1, 0], [0, 1]]);
b = np.array([1,2]);

print(lstsq(a,b));

Since a is 2x2 matrix of rank 2, I expect the residual to be 0 instead of empty list according to the doc (http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.lstsq.html). But here is what I get:

(array([ 1.,  2.]), array([], dtype=float64), 2, array([ 1.,  1.]))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0