Apply filter on one column and replicate the values in another column for the same filter

Current Pandas dataframe with two columns (A, B) as below

Column A = G, H, A, B, D, A, A

Column B = apple, banana, peach, guava, orange, grapes, strawberry

On Column A, I want to first filter out only ‘A

Next I want to update ‘A‘ in the corresponding fields of Column B as described below retaining the other values in B

Desired Pandas dataframe

Column A = G, H, A, B, D, A, A

Column B = apple, banana, A, guava, orange, A, A

Hope my question is clear and understood. Requesting assistance with the code. Thanks in advance

Answer

If I understood you correctly:

df.loc[df['A']=='A','B']='A'

Result df:enter image description here