Skip navigation
All Places >

python snippets

Log in to follow, share, and participate in this socialgroup.

Recent Activity

Hello,    With the following script I was able to determine the maximum values of a column [POINT_Z] for certain groups from [ID_1].             #creating a list ->"mast_value" with unique values of field [ID_1]     with arcpy.da.SearchCursor(inLAS[:-4] + '_POLE_POINTS.SHP','ID_1') as max_cursor:         for row in max_cursor:            … (Show more)
in python snippets
Hi all,   I'm working on a script that uses the 'memory' workspace as layers are being processed, and I've hit an issue when I try to execute a field calculation between joined layers.  I have included a script below that demonstrates the differences between workflows - the calculation will work fine if I create the feature layers from layers on… (Show more)
in python snippets
Newbie here. I've been trying to solve this for weeks and have searched and tried many suggestions from this site and still can't get this to work correctly.  I'm trying to use a derived value (max) from the Value field of a raster and use it in a calculation on each row of that field, and put the results in a new field (then use that field as a… (Show more)
in python snippets
Click to view contentI am currently trying to write a script that iterates through files in a folder to do geoprocessing. However, I am getting held up at the very start of my code with an error I cannot explain or find an answer to. I am basically a novice at Python scripting, however, I have used arcpy and pyscripter successfully throughout my schooling to run… (Show more)
in python snippets
To whom it may concern   A recent update for ArcGIS Pro 2.5.0 and ArcPY will cause serious issues to features and shapefiles.   While testing some code I wrote between myself and our GIS analyst, I found something very odd occurring with the following sample code snipet., "DesiredFieldName",… (Show more)
in python snippets
The code given below is setting value of the field as 'None' instead of Null?   import arcpy fc = 'c:/data/base.gdb/well' fields = ['Name'] with arcpy.da.UpdateCursor(fc, fields) as cursor:     for row in cursor:         row[0] = None         cursor.updateRow(row)   arcmap version 10.2 I need to set these string values to null ?
in python snippets
so, the following command works (env pointed to a gdb):'TestData_replaced', 'DMSLat','LAT_DMS','LAT_DMS') However, if the same feature class is stored in memory, and I run it, like so:"memory\tempDataLayer","DMSLat","LAT_DMS","LAT_DMS") I get the following:… (Show more)
in python snippets
Hi, I am trying to use arcpy to run a select by location and export the resulting selection (intersect) as a new feature class. I have set my workspace to the gdb containing the featureclasses I want to select by, and the features I want to select are a tile index feature class called 'tile_index'. The code will run but doesn't have any output.… (Show more)
in python snippets
ArcGIS custom toolbox which uses a python script, for updating a mass amount of field aliases at once, using a list of field names and corresponding aliases input by user. Let’s say you have an ArcGIS feature class or table with a bunch of cryptic, abbreviated field names, and you want to add aliases to make them easier to understand. Let’s say…
in python snippets
Load more items