Skip to content

pycensus.census.countries.canada.toronto.loader

Loader for the City of Toronto "Neighbourhood Profiles" (Statistics Canada 2021 Census aggregated to the 158 social-planning neighbourhoods), returning a common-schema GeoDataFrame at level neighbourhood.

Technical aspects

Used where StatCan's own dissemination-area tables cannot be reached (statcan.gc.ca answers 403 / "website unavailable" to some networks). Both inputs come from the City of Toronto open-data CKAN portal (ckan0.cf.opendata.inter.prod-toronto.ca, keyless): the 2021 profile workbook (one row per characteristic, one column per neighbourhood) and the neighbourhood boundaries (EPSG:4326 GeoJSON). schema/toronto_schema.json (generated by :mod:.build_schema) lists every exposed characteristic with the workbook row(s) it comes from (codes = "<section title>||<row label>"; several codes are summed, a leading - subtracts).

Columns named like a pycensus global-schema feature are returned bare (population, households, ...); every other one is prefixed statcan_ (it is Statistics Canada 2021 Census data).

load(aoi=None, level='neighbourhood', cache_dir=None, data_dir=None, canada_dir=None, **_ignored)

Toronto neighbourhoods (or, with the Ontario Census Profile on disk, dissemination areas) with every schema characteristic.

Parameters:

Name Type Description Default
aoi Optional[GeoDataFrame]

Area of interest (GeoDataFrame).

None
level str

"neighbourhood" or "dissemination-area".

'neighbourhood'
cache_dir Optional[str]

Cache folder; None = the pycensus cache.

None
data_dir Optional[str]

Folder of the raw downloads; None = the pycensus cache.

None
canada_dir Optional[str]

Folder of the Canada census downloads.

None
**_ignored

Ignored.

{}

Returns:

Type Description
GeoDataFrame

GeoDataFrame (EPSG:4326).