def session_array(slots):
    """
    Return a numpy array mapping sessions to slots

    - Rows corresponds to sessions
    - Columns correspond to slots
    """
    # Flatten the list: this assumes that the sessions do not share slots
    sessions = sorted(set([slot.session for slot in slots]))
    array = np.zeros((len(sessions), len(slots)))
    for col, slot in enumerate(slots):
        array[sessions.index(slot.session), col] = 1
    return array
Return a numpy array mapping sessions to slots

    - Rows corresponds to sessions
    - Columns correspond to slots