def unit_convert(df, coln1, coln2, unit, conversion_factor, coln3):
    """
    Converts values in coln3 if coln2 == unit, based on the conversion
    factor, and assigns to coln1
    """
    df.loc[df[coln2] == unit, coln1] = conversion_factor * df[coln3]
    return df