Hi David,
sorry for the missing syntax highlighting. I corrected my initial post, so it should be less confusing.
Furthermore I tried your sugestion, but unfortuntaly I got the same error message:
ValueError: max() arg is an empty sequence
with arcpy.da.SearchCursor(inLAS[:-4] + '_POLE_POINTS.SHP','ID_1') as max_cursor:
for row in max_cursor:
mast_value = sorted({row[0] for row in max_cursor})
field = "ID_1"
for mast in mast_value:
abfrage = field + " = " + str(mast)
with arcpy.da.SearchCursor(inLAS[:-4] + '_POLE_POINTS.SHP',('POINT_Z', 'FID'), where_clause=abfrage) as mast_cursor:
mylist = []
for row1 in mast_cursor:
mylist.append(max(mast_cursor))
print(str(max(mast_cursor)))