def make_features(locations_file='blocations.csv',
timeseries_file='burundioutput.csv',
startdate='2015-05-01'):
locations = pd.read_csv(locations_file)
timeseries = pd.read_csv(timeseries_file)
n_days = timeseries.shape[0]
# Construct an index with real dates rather than day numbers
timeseries.index = pd.date_range(startdate, periods=n_days)
features = []
for location in locations.itertuples(name='Location'):
latlon = (location.latitude, location.longitude)
loctype_by_day = get_loctype(location, timeseries.index)
population_by_day = get_population(timeseries, location.name)
data_for_location = pd.DataFrame({'loctype': loctype_by_day,
'population': population_by_day})
feature = mgj.make_gj_points(latlon, location.name, data_for_location)
features.extend(feature)
return features
评论列表
文章目录