A matrix of rows and columns, where each row and column can be retrieved as a list. Values can be any kind of Python object.
(self, rows=[], fields=None, **kwargs)
| 1649 | class Datasheet(CSV): |
| 1650 | |
| 1651 | def __init__(self, rows=[], fields=None, **kwargs): |
| 1652 | """ A matrix of rows and columns, where each row and column can be retrieved as a list. |
| 1653 | Values can be any kind of Python object. |
| 1654 | """ |
| 1655 | # NumPy array, convert to list of int/float/str/bool. |
| 1656 | if rows.__class__.__name__ == "ndarray": |
| 1657 | rows = rows.tolist() |
| 1658 | self.__dict__["_rows"] = DatasheetRows(self) |
| 1659 | self.__dict__["_columns"] = DatasheetColumns(self) |
| 1660 | self.__dict__["_m"] = 0 # Number of columns per row, see Datasheet.insert(). |
| 1661 | CSV.__init__(self, rows, fields, **kwargs) |
| 1662 | |
| 1663 | def _get_rows(self): |
| 1664 | return self._rows |
nothing calls this directly
no test coverage detected