This is what my dataframe looks like, How can i fetch column b of the dataframe where a=[98,43,23,2,5] such that it returns [12,39,23,32,78]
a b c
2 32 34
5 78 23
98 12 11
23 23 66
43 39 43
I want to write a method that takes in a list(to compare with column a), and returns a list back(corresponding values of b) from the dataframe.
def get_reordered_b_according_to_a(a_list):
#code
return reordered_list_b
How can I do this efficiently?