Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8155807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:46:17+00:00 2026-06-06T16:46:17+00:00

I run a qr factorization in numpy which returns a list of ndarrays ,

  • 0

I run a qr factorization in numpy which returns a list of ndarrays, namely Qand R:

>>> [q,r] = np.linalg.qr(np.array([1,0,0,0,1,1,1,1,1]).reshape(3,3))

R is a two-dimensional array, having pivoted zero-lines at the bottom (even proved for all examples in my test set):

>>> print r
[[ 1.41421356  0.70710678  0.70710678]
 [ 0.          1.22474487  1.22474487]
 [ 0.          0.          0.        ]]

. Now, I want to divide R in two matrices R_~:

[[ 1.41421356  0.70710678  0.70710678]
 [ 0.          1.22474487  1.22474487]]

and R_0:

[[ 0.          0.          0.        ]]

(extracting all zero-lines). It seems to be close to this solution: deleting rows in numpy array.

EDIT:
Even more interesting: np.linalg.qr() returns a n x n-matrix. Not, what I would have expected:

A := n x m
Q := n x m
R := n x m
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T16:46:19+00:00Added an answer on June 6, 2026 at 4:46 pm

    Use np.all with an axis argument:

    >>> r[np.all(r == 0, axis=1)]
    array([[ 0.,  0.,  0.]])
    >>> r[~np.all(r == 0, axis=1)]
    array([[-1.41421356, -0.70710678, -0.70710678],
           [ 0.        , -1.22474487, -1.22474487]])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The Run > Debug History menu item in Eclipse (Helios) contains a MRU list
I run into this problem. I have a textarea which I only want to
I run my sites all on InnoDB tables which is working really well so
I run some validation on my form when a checkbox is clicked, which works
We run an AI programming competition in which contestants will code an AI that
I run this code: graphic.addAnimation("standart",new int[] {0,1},1.0,true); which calls the graphic.addAnimation(String,int[],float,boolean) Method: public void
I run a script which calls another script through a ssh connection. My script
I run a situation where I put stuff into array like that: $current_pms[] =
I run the drvupdate-64 installer which runs until it closes and I get a
I run a query sometimes and it just hangs. I go look at processes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.