tabsdata.tableframe.lazyframe.frame.TableFrame.last_row#
- TableFrame.last_row(named: bool = False) tuple[Any, ...] | dict[str, Any] | None [source]#
Return a tuple or dictionary with the last row, or None if no row.
Example:
>>> import tabsdata as td >>> >>> tf: td.TableFrame ... >>> ┌─────┬─────┐ │ A ┆ B │ │ --- ┆ --- │ │ str ┆ i64 │ ╞═════╪═════╡ │ a ┆ 1 │ │ b ┆ 2 │ │ c ┆ 3 │ └─────┴─────┘ >>> >>> tf.last_row() >>> ('c', 3) >>> >>> tf.last_row(named=True) >>> {'A': 'c', 'B': 3}