The rows of this matrix are not linearly independent, as the first two rows can be added (or XORed) to produce the third:
matrix = [
[ 1, 0, 0, 1 ],
[ 0, 0, 1, 0 ],
[ 1, 0, 1, 1 ],
[ 1, 1, 0, 1 ]
]
One could do brute-force reduction of the rows, with deeply nested for loops and if conditions and testing for an all zero row, but the resulting code doesn't feel like python.
Without using numpy or other library, what is a pythonic way of testing for independent rows (on much larger matrices)?