iode.Table.__getitem__
- Table.__getitem__(index: int) TableLine[source]
Get a line of the table.
- Parameters:
- index: int
index of the line.
- Returns:
- TableLine
Examples
>>> from iode import SAMPLE_DATA_DIR >>> from iode import Table, comments, lists, variables >>> comments.load(f"{SAMPLE_DATA_DIR}/fun.cmt") Loading .../fun.cmt 317 objects loaded >>> lists.load(f"{SAMPLE_DATA_DIR}/fun.lst") Loading .../fun.lst 17 objects loaded >>> variables.load(f"{SAMPLE_DATA_DIR}/fun.var") Loading .../fun.var 394 objects loaded >>> table_title = "Table example" >>> lines_titles = ["GOSG:", "YSSG+COTRES:", "OCUG:"] >>> lines_lecs = ["GOSG", "YSSG+COTRES", "OCUG"] >>> table = Table(2, table_title, lines_lecs, lines_titles, True, True, True) >>> table DIVIS | 1 | TITLE | "Table example" ----- | ---------------------------- CELL | | "#S" ----- | ---------------------------- CELL | "GOSG:" | GOSG CELL | "YSSG+COTRES:" | YSSG+COTRES CELL | "OCUG:" | OCUG ----- | ---------------------------- MODE | FILES | DATE | nb lines: 11 nb columns: 2 language: 'ENGLISH' gridx: 'MAJOR' gridy: 'MAJOR' graph_axis: 'VALUES' graph_alignment: 'LEFT'
>>> table[0] Table example >>> table[1] --- >>> table[4] ('"GOSG:"', 'GOSG') >>> table[-3] <MODE> >>> table[-2] <FILES> >>> table[-1] <DATE>