npr99 / intersect-community-data

Python functions to obtain and clean data required for the version 2 Housing Unit Allocation. Workflow uses Census API.
18 stars 14 forks source link

dtype for point_gdf #61

Open npr99 opened 3 months ago

npr99 commented 3 months ago

/workspaces/intersect-community-data/pyncoda/ncoda_00e_geoutilities.py:294: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '4110850' has dtype incompatible with float64, please explicitly cast to a compatible dtype first. copy_point_gdf.loc[precise_matches.index,geolevel+col] = polygon[col] /workspaces/intersect-community-data/pyncoda/ncoda_00e_geoutilities.py:294: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value 'Cannon Beach' has dtype incompatible with float64, please explicitly cast to a compatible dtype first. copy_point_gdf.loc[precise_matches.index,geolevel+col] = polygon[col]

npr99 commented 3 months ago

/workspaces/intersect-community-data/pyncoda/ncoda_00e_geoutilities.py

Change lines 293

    # Explicitly cast to compatible dtype if necessary
    value = polygon[col]
    if copy_point_gdf[geolevel + col].dtype == 'float64':
        value = float(value)
    copy_point_gdf.loc[
        precise_matches.index, geolevel + col
    ] = value