# Python sympy | Matrix.columnspace() method

With the help of sympy.Matrix().columnspace() method, we can find the Columnspace of a Matrix. Matrix().columnspace() returns a list of column vectors that span the columnspace of the matrix.

Syntax: Matrix().columnspace()

Returns: Returns a list of column vectors that span the columnspace of the matrix.

Example #1:

 `# import sympy  ` `from` `sympy ``import` `*`  ` `  `M ``=` `Matrix([[``1``, ``0``, ``1``, ``3``], [``2``, ``3``, ``4``, ``7``], [``-``1``, ``-``3``, ``-``3``, ``-``4``]]) ` `print``(``"Matrix : {} "``.``format``(M)) ` `  `  `# Use sympy.columnspace() method  ` `M_columnspace ``=` `M.columnspace()   ` `     `  `print``(``"Columnspace of a matrix : {}"``.``format``(M_columnspace))   `

Output:

```Matrix : Matrix([[1, 0, 1, 3], [2, 3, 4, 7], [-1, -3, -3, -4]])
Columnspace of a matrix : [Matrix([
[ 1],
[ 2],
[-1]]), Matrix([
[ 0],
[ 3],
[-3]])]
```

Example #2:

 `# import sympy  ` `from` `sympy ``import` `*`  ` `  `M ``=` `Matrix([[``14``, ``0``, ``11``, ``3``], [``22``, ``23``, ``4``, ``7``], [``-``12``, ``-``34``, ``-``3``, ``-``4``]]) ` `print``(``"Matrix : {} "``.``format``(M)) ` `  `  `# Use sympy.columnspace() method  ` `M_columnspace ``=` `M.columnspace()   ` `     `  `print``(``"Columnspace of a matrix : {}"``.``format``(M_columnspace))  `

Output:

```Matrix : Matrix([[14, 0, 11, 3], [22, 23, 4, 7], [-12, -34, -3, -4]])
Columnspace of a matrix : [Matrix([
[ 14],
[ 22],
[-12]]), Matrix([
[  0],
[ 23],
[-34]]), Matrix([
[11],
[ 4],
[-3]])]
```

My Personal Notes arrow_drop_up

Coder Machine Learner Social Activist Vocalist

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.