很久没用arcpy了,碰了好几次壁,把这次做的贴上来,以备下次可以跳过这些简单的问题
import arcpy
arcpy.env.workspace = 'C:\Users\Qian\Documents\ArcGIS\Default.gdb'
a=['sichuan1990','sichuan2000','sichuan2010']
b=['藏族','彝族','羌族','回族']
for x in a:
for y in b:
arcpy.MeanCenter_stats(x, x+y+"1.shp", y, "#", "#") import arcpy
arcpy.env.workspace = 'C:\Users\Qian\Documents\ArcGIS\Default.gdb'
a=['*1990','*2000','*2010']
b=['*','哈萨克族','回族','柯尔克孜族']
for x in a:
for y in b:
arcpy.MeanCenter_stats(x, x+y+"1.shp", y, "#", "#")
重点在于计算地理中心函数的第一个变量无需加.shp。