I have DataFrame like below:
df = pd.DataFrame({"day" : ["A", "A", "B", "B"],
"data" : ["01.05.2019", "05.02.2019", "10.11.2019", "15.08.2018"]})
df["data"] = df["data"].astype("datetime64")
And I list of datas: list = pd.to_datetime(['01.05.2019','15.08.2018', '25.07.2012'])
And I need to to add to df column = "col1" where:
1 where df"day" = B and df"data" is in "list"
0 otherwise
So I need result like below: