Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Matrix
#2
The all function is your friend. You could do all on each row as a list comprehension, and then all on the result. Depending on the size of the matrix, doing it as a loop so you can short circuit in may be good. Then you would loop through the rows, any on each row, break if it's false, and else on the loop for if all of them are true.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Matrix - by Helmi - Feb-02-2019, 03:02 AM
RE: Matrix - by ichabod801 - Feb-02-2019, 03:06 AM
RE: Matrix - by Helmi - Feb-02-2019, 03:34 AM
RE: Matrix - by ichabod801 - Feb-02-2019, 04:30 AM
RE: Matrix - by perfringo - Feb-02-2019, 04:58 AM
RE: Matrix - by perfringo - Feb-02-2019, 08:37 AM
RE: Matrix - by Helmi - Feb-02-2019, 01:02 PM
RE: Matrix - by ichabod801 - Feb-02-2019, 04:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Check if two matrix are equal and of not add the matrix to the list quest 3 984 Jul-10-2023, 02:41 AM
Last Post: deanhystad
  How to multiply a matrix with herself, until the zero matrix results peanutbutterandjelly 3 3,523 May-03-2021, 06:30 AM
Last Post: Gribouillis
  matrix from matrix python numpy array shei7141 1 3,830 Jan-16-2017, 06:10 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020