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
评论列表
文章目录