If i am writing this function:
def find_val (df, name, name_val):
value = df[ df[str(name)].map(name).eq(name_val) ]
return value
Here the name is same but in different form. First as name of column in dataframe and second the same name is in the form of dictionary. I am trying to avoid this:
def find_val (df, name_col, name_dict, name_val):
# here name_col and name_dict have the same name. for example 'brands' then brands is a column in my df as well a seperate dictionary named brands.
Is this possible to avoid?