File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 11# Name: ComputeWeightedIndex.py
22# Purpose: This function will return a weighted index based on the input feature class and the input variable weight value table.
33# Author: David Wasserman
4- # Last Modified: 6/29/2024
4+ # Last Modified: 3/6/2025
55# Copyright: David Wasserman
66# Python Version: 3.9
77# ArcGIS Version: 3.2 Pro
@@ -75,9 +75,9 @@ def compute_weighted_index(
7575 for key in weight_dict :
7676 weight = weight_dict [key ]
7777 if output_field_name in df .columns :
78- df [output_field_name ] = df [var ] * weight + df [output_field_name ]
78+ df [output_field_name ] = df [var ]. astype ( float ) * float ( weight ) + df [output_field_name ]
7979 else :
80- df [output_field_name ] = df [var ] * weight
80+ df [output_field_name ] = df [var ]. astype ( float ) * float ( weight )
8181
8282 # Prepare for export
8383 JoinField = arcpy .ValidateFieldName ("DFIndexJoin" , workspace )
You can’t perform that action at this time.
0 commit comments