Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

population-exposure

CI PyPI Python License

population-exposure adds population estimates to hazard tables, polygons, and raster cells.

Install

pip install population-exposure

Python 3.11 or newer is required.

What the result estimates

assign_population() returns the estimated population represented by the selected source and reference year. Spatial hazards use coverage-weighted allocation; table hazards use exact key joins. It does not identify observed people, exact households, or who was present during an event. Boundary cells contribute according to their covered area; finer output grids redistribute source counts but do not add demographic detail. Source meaning, resolution, modeling choices, and hazard scale limit local inference.

For raster hazards, the conservation check is a numerical alignment check, not validation of the source and not an uncertainty interval. Report the source or release, population year and meaning, hazard date and threshold, allocation method, reprojection choice, incomplete support, and conservation difference when applicable.

Quick start

import pandas as pd

import population_exposure as pe

population_source = "illustrative counts"
population_year = "not applicable"
hazard = pd.DataFrame({"cell": ["A", "B"], "risk": ["high", "low"]})
population = pd.DataFrame({"cell": ["A", "B"], "population": [100, 200]})

exposed = pe.assign_population(hazard, population, cell_columns="cell")
print(f"{population_source} ({population_year}):")
print(exposed)

This toy table has no external population source or reference year. Replace it with a documented source and year for a real analysis.

Documentation

Read the full documentation for vector and raster workflows, population sources, and the API reference.

Project

Source code · Issue tracker · Contributing · Code of conduct · Changelog · MIT License

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

population_exposure-0.1.0rc2.tar.gz (2.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

population_exposure-0.1.0rc2-py3-none-any.whl (60.3 kB view details)

Uploaded Python 3

File details

Details for the file population_exposure-0.1.0rc2.tar.gz.

File metadata

  • Download URL: population_exposure-0.1.0rc2.tar.gz
  • Upload date:
  • Size: 2.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for population_exposure-0.1.0rc2.tar.gz
Algorithm Hash digest
SHA256 84da63fe7eaa83b265ccec5bef02b674412e233c692d663e4dcd9c6f69256381
MD5 a7526089bbfbc8ab8e47dbbf96dbf91d
BLAKE2b-256 20a0dfb35de55178a35cf4f0ad3f6fee9f047e2a5f05af74f870ce63d6401182

See more details on using hashes here.

Provenance

The following attestation bundles were made for population_exposure-0.1.0rc2.tar.gz:

Publisher: publish.yml on palewire/population-exposure

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file population_exposure-0.1.0rc2-py3-none-any.whl.

File metadata

File hashes

Hashes for population_exposure-0.1.0rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 4c9ccb935c2653be7666c957f4543f066ecc12d97b125065e922928b4dce28ad
MD5 92a75fded03eca6351c2d9923c5d5649
BLAKE2b-256 433cf2804fc3b12811df0e35cb85e3eac7c1de18584b319d14e79a7d8b014907

See more details on using hashes here.

Provenance

The following attestation bundles were made for population_exposure-0.1.0rc2-py3-none-any.whl:

Publisher: publish.yml on palewire/population-exposure

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0rc2 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page