map_camps_timehistory.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:Visualflee 作者: cspgdds 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号