I would like to add a column to a pandas dataframe based on the value from another dataframe. Here is table 1 and table 2. I would like to update the duration for table 1 based on the value from table 2. Eg, row 1 in Table 1 is Potato, so the duration should be updated to 30 based on value from table 2.
Table 1
| Crops | Entry Time | Duration |
|---|---|---|
| Potato | 2022-03-01 | 0 |
| Cabbage | 2022-03-02 | 0 |
| Tomato | 2022-03-03 | 0 |
| Potato | 2022-03-0 | 0 |
Table 2
| Crops | Duration |
|---|---|
| Potato | 30 |
| Cabbage | 20 |
| Tomato | 25 |
Thanks.