teehr.LocationAttributeTable#

class teehr.LocationAttributeTable(ev)[source]#

Bases: BaseTable

Access methods to location attributes table.

Methods

distinct_values

Return distinct values for a column.

field_enum

Get the location attribute fields enum.

fields

Return table columns as a list.

filter

Apply a filter.

load_csv

Import location_attributes from CSV file format.

load_parquet

Import location_attributes from parquet file format.

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 for Location Attributes.

to_sdf

Return PySpark DataFrame.

validate

Validate the dataset table against the schema.

field_enum() LocationAttributeFields[source]#

Get the location attribute fields enum.

load_csv(in_path: Path | str, pattern: str = '**/*.csv', field_mapping: dict | None = None, **kwargs)[source]#

Import location_attributes from CSV file format.

Parameters:
  • in_path (Union[Path, str]) – The input file or directory path. CSV file format.

  • field_mapping (dict, optional) – A dictionary mapping input fields to output fields. Format: {input_field: output_field}

  • **kwargs – Additional keyword arguments are passed to pd.read_parquet().

Notes

The TEEHR Location Attribute table schema includes fields:

  • location_id

  • attribute_name

  • value

load_parquet(in_path: Path | str, pattern: str = '**/*.parquet', field_mapping: dict | None = None, **kwargs)[source]#

Import location_attributes from parquet file format.

Parameters:
  • in_path (Union[Path, str]) – The input file or directory path. Parquet file format.

  • field_mapping (dict, optional) – A dictionary mapping input fields to output fields. Format: {input_field: output_field}

  • **kwargs – Additional keyword arguments are passed to pd.read_parquet().

Notes

The TEEHR Location Attribute table schema includes fields:

  • location_id

  • attribute_name

  • value

to_geopandas()[source]#

Return GeoPandas DataFrame.

to_pandas()[source]#

Return Pandas DataFrame for Location Attributes.