def map_locations_to_nodes(df, node_df):
    """
    Maps the location ID to node ID and
    changes column names in a df.
    """
    data = df.copy()
    data.rename(columns={
        "location_id": "c_location_id",
        "location": "c_location"
    }, inplace=True)
    data['c_location_id'] = data['c_location_id'].astype(int)
    data = data.merge(
        node_df[["node_id", "c_location_id"]],
        on=["c_location_id"]
    )
    return data