teehr.AttributeTable#

class teehr.AttributeTable(ev)[source]#

Bases: DomainTable

Access methods to attributes table.

Methods

add

Add an attribute to the evaluation.

distinct_values

Return distinct values for a column.

field_enum

Get the attribute 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(attribute: Attribute | List[Attribute])[source]#

Add an attribute to the evaluation.

Parameters:

attribute (Union[Attribute, List[Attribute]]) – The attribute domain to add.

Example

>>> from teehr.models.domain_tables import Attribute
>>> attribute = Attribute(
>>>     name="drainage_area",
>>>     type="continuous",
>>>     description="Drainage area in square kilometers"
>>> )
>>> ev.load.add_attribute(attribute)
field_enum() AttributeFields[source]#

Get the attribute fields enum.