Seems like there are many DF questions with conditions from another DF but I can't find any that do what I need. Both dataframes are small samples. They are each thousands of columns wide. I have a DataFrame (df1) that looks like this
IBM BA CAT IBM EARN BA EARN CAT EARN
Date
1/22/2018 163.13 65.94 76.50 NaN NaN NaN
1/23/2018 163.17 65.94 76.51 NaN NaN NaN
1/24/2018 167.26 67.43 79.23 NaN NaN NaN
1/25/2018 166.28 67.77 80.57 NaN NaN NaN
1/26/2018 166.58 68.37 80.87 NaN NaN NaN
1/27/2018 166.77 68.87 81.07 NaN NaN NaN
1/28/2018 167.98 68.57 81.07 NaN NaN NaN
2/1/2018 167.98 68.77 81.59 NaN NaN NaN
2/2/2018 167.98 69.07 81.87 NaN NaN NaN
I have another dataframe (df2) with identical columns as the last three in df1 but with specific dates
IBM EARN BA EARN CAT EARN
0 1/22/2018 2/1/2018 1/26/2018
1 10/19/2017 10/26/2017 10/25/2017
2 7/20/2017 7/27/2017 7/26/2017
3 4/20/2017 4/27/2017 4/26/2017
4 1/23/2017 1/26/2017 1/27/2017
5 10/19/2016 10/27/2016 10/26/2016
6 7/20/2016 7/28/2016 7/27/2016
I want to place a 1 in df1 where there is a corresponding date in df2. So the (partial) result would look like this but would continue for all dates list in df2.
IBM BA CAT IBM EARN BA EARN CAT EARN
Date
1/22/2018 163.13 65.94 76.50 **1** NaN NaN
1/23/2018 163.17 65.94 76.51 NaN NaN NaN
1/24/2018 167.26 67.43 79.23 NaN NaN NaN
1/25/2018 166.28 67.77 80.57 NaN NaN NaN
1/26/2018 166.58 68.37 80.87 NaN NaN **1**
1/27/2018 166.77 68.87 81.07 NaN NaN NaN
1/28/2018 167.98 68.57 81.07 NaN NaN NaN
2/1/2018 167.98 68.77 81.59 NaN **1** NaN
2/2/2018 167.98 69.07 81.87 NaN NaN NaN
Please let me know if you can help with a solution