I`am looking desperate for help .. somehow I got list in a seemingly easy task.
I have a list with values:
quotes = ['1234','34523','34234','34242',...]
And a dataframe:
index | quote | business_type |
---|---|---|
0 | 1234 | Cloud |
1 | 6623 | Cloud |
2 | 1234 | Cloud |
... | ... | ... |
Now I want to copy just the quotes which are in my list quotes
and create a new dataframe with all columns of the given df
For that I already tried to use is_in:
dict_unique_quote_id = {'quotes':[quotes]}
q = df.isin(dict_unique_quote_id).all(1)
print(q)
But then I get a bunch of False
values. I checked it manually the values in quotes
are existing in df
.
I think I am getting something fundamentally wrong .. thanks for your help!!