> ## Documentation Index
> Fetch the complete documentation index at: https://docs.graphext.com/llms.txt
> Use this file to discover all available pages before exploring further.

# fetch_demographics_es

> Fetch Spanish demographic census data given a geographical location in each row. 

Using geographical coordinates provided by latitude and longitude columns, enriches the input dataset with
a subset of the 2011 Spanish census. See below for the seven features to be added by the step.

## Usage

The following example shows how the step can be used in a recipe.

<Accordion title="Examples" icon="code" defaultOpen="true">
  <Tabs>
    <Tab title="Example 1">
      Since the step has no configuration parameters, it's simply

      ```stan theme={null}
      fetch_demographics_es(ds.lat, ds.lon) -> (
        ds.Dem_Extranjeros_pct,
        ds.Dem_Casados_pct,
        ds.Dem_Edad,
        ds.Dem_Nivel_Estudios,
        ds.Dem_Vivienda_m2,
        ds.Dem_Personas_Hogar,
        ds.Dem_Location_Idx
      )
      ```
    </Tab>

    <Tab title="Signature">
      General syntax for using the step in a recipe. Shows the inputs and outputs the step is expected to receive and will produce respectively. For futher details see sections below.

      ```stan theme={null}
      fetch_demographics_es(lat: number, lon: number
      ) -> (
      	Dem_Extranjeros_pct: number,
      	Dem_Casados_pct: number,
      	Dem_Edad: number,
      	Dem_Nivel_Estudios: number,
      	Dem_Vivienda_m2: number,
      	Dem_Personas_Hogar: number,
      	Dem_Location_Idx: number
      )
      ```
    </Tab>
  </Tabs>
</Accordion>

## Inputs & Outputs

The following are the inputs expected by the step and the outputs it produces. These are generally
columns (`ds.first_name`), datasets (`ds` or `ds[["first_name", "last_name"]]`) or models (referenced
by name e.g. `"churn-clf"`).

<Accordion title="Inputs" icon="right-to-bracket">
  <ParamField path="lat" type="column[number]" required>
    A numeric column containing latitude coordinates of the places of interest.
  </ParamField>

  <ParamField path="lon" type="column[number]" required>
    A numeric column containing longitude coordinates of the places of interest.
  </ParamField>
</Accordion>

<Accordion title="Outputs" icon="right-from-bracket">
  <ParamField path="Dem_Extranjeros_pct" type="column[number]" required>
    A numeric column containing the percentage of immigrants registered in the area.
  </ParamField>

  <ParamField path="Dem_Casados_pct" type="column[number]" required>
    A numeric column containing the percentage of married people in the area.
  </ParamField>

  <ParamField path="Dem_Edad" type="column[number]" required>
    A numeric column containing the average age in the area.
  </ParamField>

  <ParamField path="Dem_Nivel_Estudios" type="column[number]" required>
    A numeric column containing the average level of education.
  </ParamField>

  <ParamField path="Dem_Vivienda_m2" type="column[number]" required>
    A numeric column containing the average size of households in square meters.
  </ParamField>

  <ParamField path="Dem_Personas_Hogar" type="column[number]" required>
    A numeric column containing the average number of household members.
  </ParamField>

  <ParamField path="Dem_Location_Idx" type="column[number]" required>
    A numeric column containing an index in the range 1-9 summarizing the overall quality of the location; lower
    values being better.
  </ParamField>
</Accordion>

## Configuration

The following parameters can be used to configure the behaviour of the step by including them in
a json object as the last "input" to the step, i.e. `step(..., {"param": "value", ...}) -> (output)`.

<Accordion title="Parameters" defaultOpen="true" icon="sliders">
  This step doesn't expect any configuration.
</Accordion>
