Visual Matrix - module for python, allowing you to display matrices or tables in a beautiful form.
- Create and view tables and matrix;
Table visual
Table visual (with border)
Matrix visual
from vismatrix import VisualMatrix
header = ["Name", "Age", "Sex"]
m = [["Alexandra", "18", "Female"],
["Igor", "21", "Male"],
["Vladimir", "18", "No"]]
matrix = VisualMatrix() # initialization
matrix.setMatrix(m, header, True) # method in which you can immediately initialize a matrix with header
# and without borders
matrix.myMatrix()
matrix.setMatrix(m) # method in which you can immediately initialize a matrix without header
matrix.myMatrix()
First way
from vismatrix import VisualMatrix
matrix = VisualMatrix() # initialization
# second way (in this way you cant change no_border parameter)
matrix.addHeader(["Name", "Age", "Sex"])
matrix.addRow(["Alexandra", "18", "Female"])
matrix.addRow(["Igor", "21", "Male"])
matrix.addRow(["Vladimir", "18", "No"])
matrix.myMatrix()
matrix.addRow(["Alexandra", "18", "Female"])
matrix.addRow(["Igor", "21", "Male"])
matrix.addRow(["Vladimir", "18", "No"])
matrix.myMatrix()
Second way
-The output from both methods will be the same. You can immediately assign lists to methods (as in the first method with header)
Adds a table header.
Parameter | Type | Description |
---|---|---|
header |
list |
Is the header for the table |
Adds a row table/matrix.
Parameter | Type | Description |
---|---|---|
row |
list |
Matrix or table row |
Creates a matrix or table (Depending on whether a header is specified or not).
Parameter | Type | Description |
---|---|---|
user_matrix |
list |
Matrix or table`s data |
header |
list |
Table`s header |
no_border |
bool |
Use borders (True - No, False - Yes) |
Output table or matrix. Must be written at the end of creating a matrix or table
pip install vismatrix