Find matches between columns and manipulate data based on match
One possible way to solve this would be to create a dictionary of which components should be changed and then use replace. So in the example above, we want to create a dictionary {'B': 'A'} since all B should be replaced by A in the new Product column.

This can be done as follows:

components = df['Component'].unique()
d = df[df['Sub-component'].isin(components)].set_index('Sub-component')['Component'].to_dict()


and then we can create the new column:

df['Product'] = df['Component'].replace(d)


Resulting dataframe:

    Component   Sub-component   Product
0   A           a               A
1   A           B               A
2   A           c               A
3   B           d               A
4   B           e               A
5   B           n               A
6   B           a               A
7   B           v               A
8   B           c               A
9   B           i               A
10  C           g               C
11  C           s               C
12  C           g               C
13  C           a               C
14  C           c               C
15  C           i               C
16  C           q               C
17  C           g               C
18  C           v               C
19  C           b               C
20  C           l               C