I am new in the programming area, I have done some code making use of sources on the web. That is why I am having trouble. In my query I have used Geopandas, pandas and numpy library to make modifications in the table of a Feature class. When I run the code it performs the operation I wrote but when I check the FC in arcgis pro it does not change. Could someone help me to solve this detail?
Code
capa_feature1 = gpd.read_file(r"D:\Proj_ASEAN\Proj_ArcGIS\Proj_ASEAN\SMOD.gdb")
operacion = lambda x,y,z: (x - y -z)
capa_feature1['SUM_Area_km2'] = np.where( capa_feature1['Area_km2'] == capa_feature1.iat[0,4], capa_feature1.iat[0,4], operacion(capa_feature1.iat[0,5],capa_feature1.iat[0,4],capa_feature1.iat[1,4]))
capa_feature1
Solved! Go to Solution.
You're reading the data in to a GeoDataFrame (gdf) which is in memory and no longer connected to the file geodatabase (FileGDB) FeatureClass (fc), so changing the gdf will not change the fc.
You need to write the gdf back to the FileGDB and overwrite the fc.
However, the OpenFileGDB driver that GeoPandas uses is read-only (unless you install the Esri FileGDB API and driver which can be difficult) so you are better off either using
You're reading the data in to a GeoDataFrame (gdf) which is in memory and no longer connected to the file geodatabase (FileGDB) FeatureClass (fc), so changing the gdf will not change the fc.
You need to write the gdf back to the FileGDB and overwrite the fc.
However, the OpenFileGDB driver that GeoPandas uses is read-only (unless you install the Esri FileGDB API and driver which can be difficult) so you are better off either using
Thank you so much