tabsdata.tableframe.lazyframe.frame.TableFrame.has_same_schema#

TableFrame.has_same_schema(tf: TableFrame) bool[source]#

Verifies if the schema of the current TableFrame is same than the provided TableFrame.

Parameters:

tf – The TableFrame to compare with.

Returns:

Whether the condition is met or not.

Return type:

bool

Example:

>>> import tabsdata as td
>>>
>>> tf1: td.TableFrame ...
>>>
┌──────┬──────┐
│ a    ┆ b    │
│ ---  ┆ ---  │
│ str  ┆ i64  │
╞══════╪══════╡
│ A    ┆ 1    │
└──────┴──────┘
>>>
>>> tf2: td.TableFrame ...
>>>
┌──────┬──────┐
│ a    ┆ c    │
│ ---  ┆ ---  │
│ str  ┆ i64  │
╞══════╪══════╡
│ A    ┆ 1    │
└──────┴──────┘
>>> tf1.has_same_schema(tf2)
>>>
False
>>>
>>> tf1: td.TableFrame ...
>>>
┌──────┬──────┐
│ a    ┆ b    │
│ ---  ┆ ---  │
│ str  ┆ i64  │
╞══════╪══════╡
│ A    ┆ 1    │
└──────┴──────┘
>>>
>>> tf2: td.TableFrame ...
>>>
┌──────┬──────┐
│ a    ┆ b    │
│ ---  ┆ ---  │
│ str  ┆ str  │
╞══════╪══════╡
│ A    ┆ 1    │
└──────┴──────┘
>>> tf1.has_same_schema(tf2)
>>>
False