How to check if two sets of vectors span the same space in matlab/python? In MATLAB/Python, is there a way to compare the subspaces span by two different sets of vectors and check if they are the same?

Corrected version following a remark of @Quang Hoang
Here is another way :
If the sets of vectors are the columns of $A$ and $B$ resp., check that the new matrix $C=[A,B]$ is such that 
$$rank(A)=rank(B)=rank(C)$$ 
Proof: Let $R(M)$ denote the column space of a matrix $M$.
Equality $rank(A)=rank(C)$ implies $R(A)=R(C)$
Equality $rank(B)=rank(C)$, implies $R(B)=R(C)$. 
Thus $R(A)=R(B)$. Therefore $rank(A)=rank(B)$.
