Beispiel #1
0
def get_table(episode):
    table = actions_model.get_action_table_data(episode)
    table['id'] = table['timestep']
    table.set_index('id', inplace=True, drop=False)
    return [{
        "name": i,
        "id": i
    } for i in table.columns if i != "id"], table.to_dict("record")
Beispiel #2
0
def update_agent_log_action_table(study_agent, scenario):
    new_episode = make_episode(study_agent, scenario)
    table = actions_model.get_action_table_data(new_episode)
    table['id'] = table['timestep']
    table.set_index('id', inplace=True, drop=False)
    cols_to_exclude = ["id", "lines_modified", "subs_modified"]
    cols = [{
        "name": action_table_name_converter[col],
        "id": col
    } for col in table.columns if col not in cols_to_exclude]
    return cols, table.to_dict("record")
Beispiel #3
0
def get_table(episode):
    table = actions_model.get_action_table_data(episode)
    table['id'] = table['timestep']
    table['timestep_reward'] = table['timestep_reward'].map(
        lambda x: '{:,.2f}'.format(float("".join(str(x).split(",")))))
    table.set_index('id', inplace=True, drop=False)
    cols_to_exclude = ["id", "lines_modified", "subs_modified"]
    return [{
        "name": i,
        "id": i
    } for i in table.columns
            if i not in cols_to_exclude], table.to_dict("record")