geopfa.transformation.normalize_gdf

normalize_gdf(gdf, col, norm_to=1)[source]

Normalize a GeoDataFrame using min-max scaling

Normalize the values in a specified column of a GeoDataFrame using min-max scaling, such that the minimum value becomes 0 and the maximum value becomes norm_to.

Parameters:
  • gdf (geopandas.GeoDataFrame) – The GeoDataFrame containing the column to normalize.

  • col (str) – The name of the column in the GeoDataFrame to normalize.

  • norm_to (int or float, optional) – The value to which the maximum column value should be scaled (default is 1).

Returns:

  • gdf (geopandas.GeoDataFrame) – The input GeoDataFrame with the normalized column.

  • ..NOTE:: This function modifies the input GeoDataFrame in place, – thus even if the output is assigned to a new variable, the original input GeoDataFrame will be modified.