TableFrame.last_row
methodView source ↗
def last_row(named: bool = False) -> tuple[Any, ...] | dict[str, Any] | None
Categories: filters
Return a tuple or dictionary with the last row, or None if no row.
Examples
>>> 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}