I'm using this code to remove all decimal places within the symbology results of Graduated Colors. I can get it to apply to one feature class, but I can't figure out how to get it to apply to all of them (I have a total of 15).
Here is the code I'm using:
p = arcpy.mp.ArcGISProject("CURRENT")
m = p.listMaps()[0]
lyr = m.listLayers("BCBS*")[0]
sym = lyr.symbology
if sym.renderer == "GraduatedColorsRenderer":
breaks = sym.renderer.classBreaks
for b in breaks:
b_int = b.label[0:-7]
b.label = b_int
lyr.symbology= sym
All the feature classes begin with "BCBS" so I thought that BCBS*
would apply the desired results to all the feature classes but it didn't. Then I realized that [0]
was only applying it to the first feature class, but I still can't figure out how to apply it to all feature classes that begin with "BCBS"