DVector.translate_zoning#

DVector.translate_zoning(new_zoning, cache_path=None, trans_vector=None, weighting=TranslationWeighting.SPATIAL, check_totals=True, no_factors=False, one_to_one=False, _bypass_validation=False, target_zone=None)[source]#

Translate this DVector into another zoning system and returns a new DVector.

Parameters:
  • new_zoning (ZoningSystem) – The zoning system to translate into.

  • cache_path (Optional[PathLike]) – Path to a cache containing zoning translations.

  • trans_vector (pd.DataFrame = None) – If provided this is the translation vector which will be used. If not provided this method will attempt to find one from cache_path.

  • weighting (str | TranslationWeighting = TranslationWeighting.SPATIAL) – The weighting to use when building the zone_translation. Must be one of TranslationWeighting.

  • check_totals (bool = True) – Whether to raise a warning if the translated total doesn’t match the input total. Should be set to False for one-to-one translations.

  • no_factors (bool = False) – Whether to run as a one-to-one zone_translation, e.g. all data will be multiplied by one, and zone numbers will change. This should only be used for perfectly nesting zone systems when disaggregating, e.g. msoa to lsoa.

  • one_to_one (bool = False) – If True will force a one-to-one translation, where the largest factor is chosen for each zone combination. This will turn on no_factors as well.

  • _bypass_validation (bool)

  • target_zone (ZoningSystem | None)

Returns:

This DVector translated into new_new_zoning zoning system

Return type:

translated_dvector

Warns:

TranslationWarning – If there are zone IDs missing from the zone_translation or the zone_translation factors don’t sum to 1.