【发布时间】:2022-12-14 10:33:03
【问题描述】:
我有两个数据框,我希望在 DF1 中获得一个列,该列将具有“当前日期”列的值加上与 DF2 中的相关状态和技术相关的天数。例如,在下面的“新日期”列中的第一个值是 18/03/2022 + 1095 天,因为它正在检查技术是否 = 风和状态 = 施工。
东风1
| Current Date | Technology | Status | New Date DESIRED FROM CODE |
|---|---|---|---|
| 18/03/2022 | Wind | Construction | 16/12/2022 |
| 15/02/2022 | Solar | Construction | 15/11/2022 |
| 24/01/2022 | Battery | Application approved | 24/10/2022 |
| 23/09/2020 | Wind | Application approved | 24/03/2023 |
| 18/11/2021 | Solar | Application submitted | 18/11/2023 |
| 25/06/2020 | Solar | Application approved | 25/03/2021 |
| 27/02/2020 | Wind | Application submitted | 25/02/2025 |
| 10/03/2022 | Battery | Application submitted | 09/03/2024 |
东风2
| Technology | Application submitted | Application approved | Construction |
|---|---|---|---|
| Battery | 730 | 273.75 | 273.75 |
| Solar Photovoltaics | 730 | 273.75 | 273.75 |
| Wind | 1825 | 912.5 | 1095 |
【问题讨论】: