I'm working with a dataframe structured like this one below:
A B C D
group_997 NaN Purple JMHKJALJ_06538
group_998 NaN Pink JMHKJALJ_04556
group_999 NaN Red JMHKJALJ_09211
group_995 NaN Green JMHKJALJ_16378
group_996 NaN Yellow JMHKJALJ_81324
Now I'd like to find the corresponding value of JMHKJALJ_16378
(column D
) on column A
(that is group_995
).
I tried to use:
df[df['A'].str.contains('JMHKJALJ_16378')]
But the output is not correct. How can I do that?