funcs.py 文件源码

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

项目:seetd 作者: stitchfix 项目源码 文件源码
def teams_to_seat_arr(teams, seats_arr, allocated_seats):

    if isinstance(teams.values()[0], int):
        # plot the team dist
        teams_seats_arr = np.zeros(seats_arr.shape)
    else:
        teams_seats_arr = np.chararray(seats_arr.shape)

    for person, seat in allocated_seats.iteritems():
        # get location for the seat
        y, x = np.where(seats_arr == seat)
        # now get the team for the
        team = teams[person]
        teams_seats_arr[y, x] = team

    return teams_seats_arr
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号