When querying the table of a versioned (or archive-enabled) feature class directly using SQL, your results would not be expected to reflect the current state of the feature class. You should use the versioned view instead. The table could contain records that have been deleted, or records that have been changed, or may be missing records that have been ...
I would solve the problem with NetworkX. It’s an Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks. It supports import and export of shapefile format.
Install NetworkX in your ArcGIS Python environment: pip install networkx
The following code should give you one possibility to solve your ...
Create a set and populate it with values using a cursor. If you find a value that's already in the set update your table.
ids = set ()
with arcpy.da.UpdateCursor(layer.name, "ID") as outs:
for idVal, in outs:
if idVal in ids:
row = ("",)
There is a lot going on here, i hope this answer gives you a start
1. Your function doesn't return anything! Let's take out some unnecessary stuff, change it to return a list of paths for each mxd file (we'll save arcpy stuff for later).
MapList = 
list_dir = os.listdir(path)
for paths, dirctory, files in ...
It's probably because you're just appending "_l" to the feature class path , rather than inserting it. And when the feature class is a shapefile, you end up with "filepath.shp" + "_l" which == "filepath.shp_l"
for fc in arcpy.ListFeatureClasses():
name, ext = os.path.splitext(fc)
outfc = name + "_l" + ext
You could use Result.GetMessage/GetMessages, instead of arcpy.GetMessage/GetMessages
# Last message
# Or all messages...
In your code error that you presented in the comment this is the line causing problems.
fieldList = arcpy.ListFields(fc, field_type="integer")
I think integer needs a capital I. But you don't use fieldList later. So you could either remove this line and just use
fieldObs = arcpy.ListFields (fc)
But the problem here is that you are getting fields that ...
I found that it worked much better to use the ExtractByMask option instead of the arcpy.Clip_management process. The corrected code is as follows:
from arcpy import env
#Must use the arcpy.sa for this option#
from arcpy.sa import *
env.workspace = "C:\\workspace"
env.overwriteOutput = True
points = "PrecipKansas2014"
#Check out extensions:
I guess you didn't install networkx in the ArcGIS Python environment you are currently using in ArcGIS. To be sure, that you choose the right enviromnent you should change the working Directory to the Scripts Folder of the right Python environment, before installing networkx via pip install networkx command. E.g.:
cd C:\Program Files\ArcGIS\Pro\...
In addition to using the versioned view, consideration should be made for the length of the table name. In this case, I've discovered that if adding "_EVW" to the end of the table name exceeds 30 characters, an error will be thrown. I got around this with the following:
test_tuple = ("path\to\connection", "OWNER.table_name")
own, name = test_tuple[-1].split(...