teehr.UnitTable#
- class teehr.UnitTable(ev)[source]#
Bases:
DomainTable
Access methods to units table.
Methods
Add a unit to the evaluation.
distinct_values
Return distinct values for a column.
Get the unit fields enum.
fields
Return table columns as a list.
filter
Apply a filter.
order_by
Apply an order_by.
query
Run a query against the table with filters and order_by.
to_geopandas
Return GeoPandas DataFrame.
to_pandas
Return Pandas DataFrame.
to_sdf
Return PySpark DataFrame.
validate
Validate the dataset table against the schema.
- add(unit: Unit | List[Unit])[source]#
Add a unit to the evaluation.
- Parameters:
unit (
Union[Unit
,List[Unit]]
) – The unit domain to add.
Example
>>> from teehr.models.domain_tables import Unit >>> unit = Unit( >>> name="m^3/s", >>> long_name="Cubic meters per second" >>> ) >>> ev.load.add_unit(unit)