def METHOD_NAME(data):
    cols = data["columns"]
    rows = data["rows"]
    if len(cols) == 0:
        return {"columns": [], "rows": []}
    first_row = rows[0]
    columns = []
    types = {}
    for c in cols:
        columns.append({"name": c, "type": guess_type(first_row[c]), "friendly_name": c})
    for col in columns:
        types[col["name"]] = col["type"]
    for row in rows:
        for key, value in row.items():
            row[key] = convert_type(value, types[key])
    return {"columns": columns, "rows": rows}