I have a data frame that looks like this:
df = pd.DataFrame({"A":['a','a','a','b','b','c','c','c'],
"B":['he','she',None,'I',None,None,'them','our']})
and I have a list
lst = ['a','b','c']
I would like to filter the dataframe (or get a dictionary) where only the first matching value in column "B" is returned.
my_dict = {'a':'he', 'b':'I','c':'them'}
