def encode_column(dataframe, column, values):
    """ 
        For any string valued columns, encode each unique value 
        with an integer value.
    """

    value_nums = {}

    start = 0
    for v in values:
        value_nums[str(v)] = start
        start += 1

    for index, _ in dataframe.iterrows():
        current_value = dataframe.iloc[index][column]
        dataframe.at[index, column] = value_nums[str(current_value)]

    return dataframe