python-list2d documentation
Sipmle 2d lists
Authors
Source
Instalation
Instalation is very simple via pip.
# pip install list2d
Examples
>>> from list2d import List2d
>>> a = List2d([[1,2],[3, 4]])
>>> print a
<List2d [[1, 2],[3, 4]]>
>>> b = List2d(2, 2, 0)
>>> print b
<List2d [[0, 0],[0, 0]]>
>>> a.rows()
[[1, 2], [3, 4]]
>>> a.cols()
[[1, 3], [2, 4]]
>>> a.row(0)
[1, 2]
>>> a.col(1)
[2, 4]
>>> a.reverse()
>>> print a
<List2d [[1, 3],[2, 4]]>
>>> b.set(0, 1, 10)
>>> print b
<List2d [[0, 10],[0, 0]]>
>>> b.get(0, 0)
0