通过时间数据集循环



我有一个点特征类,其中包括具有时态数据的列。我该如何收集前10年数据的平均中心,然后是前20年,前30年,等等……并导出的结果点使用Python循环?我想测量数据随时间的人口变化,而不必手动计算每十年的影响。

如果这是一个幼稚的问题,我道歉,因为我刚刚进入编程。

下面的链接包含一个文件地理数据库,其中包括我正在使用的功能类。

https://drive.google.com/file/d/0Bw8dHpiUsYU7QjlKQnRSaDV5RnM/view?usp=sharing

我最后做了这样的事情。

import os
import arcpy
in_feature = "C:\temp\mlb_birth.gdb\mlb_birthplaces"
out_features = "C:\temp\mlb_birth.gdb"
for x in range(10, 140, 10):
    year_range = int(1870 + x)
    year_out_name = os.path.join(out_features, "Years_{0}".format(x))
    mean_out_name = os.path.join(out_features, "Mean_{0}".format(x))
    arcpy.Select_analysis(in_feature, year_out_name, "birthYear <= {0}".format(year_range))
    arcpy.MeanCenter_stats(year_out_name, mean_out_name, "#", "#", "#")

最新更新