def count_encoding(df, col):
    """Get count(frequency) encoding of a column of any type.
    
    inputs:
    df - pandas dataframe
    col - column name
    
    outputs:
    count encoded column
    """
    if isinstance(col, list):
        col = col[0]
    return df[col].map(df[col].value_counts(dropna=False))
