teehr.LocationCrosswalkTable#

class teehr.LocationCrosswalkTable(ev)[source]#

Bases: BaseTable

Access methods to location crosswalks table.

Methods

distinct_values

Return distinct values for a column.

field_enum

Get the location crosswalk fields enum.

fields

Return table columns as a list.

filter

Apply a filter.

load_csv

Import location crosswalks from CSV file format.

load_parquet

Import location crosswalks 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 Crosswalk.

to_sdf

Return PySpark DataFrame.

validate

Validate the dataset table against the schema.

field_enum() LocationCrosswalkFields[source]#

Get the location crosswalk fields enum.

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

Import location crosswalks 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_csv() or pd.read_parquet().

Notes

The TEEHR Location Crosswalk table schema includes fields:

  • primary_location_id

  • secondary_location_id

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

Import location crosswalks 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_csv() or pd.read_parquet().

Notes

The TEEHR Location Crosswalk table schema includes fields:

  • primary_location_id

  • secondary_location_id

to_geopandas()[source]#

Return GeoPandas DataFrame.

to_pandas()[source]#

Return Pandas DataFrame for Location Crosswalk.