I want to create new column based on the number of rows each fruit is present in df2.

```
Expected Output of df1

No  | Fruit_Name | 2018 | 2019 | 2020 
1   | Apple      |  2   |   1  | 0
2   | Banana     |  0   |   0  | 1
3   | Cherries   |  0   |   0  | 1

```

```
     df1                                       df2
No | Fruit_Name |                year   | farmer | fruit_farmed
1  | Apple      |                2018   | John   |   Apple
2  | Banana     |                2019   | Timo   |   Apple
3  | Cherries   |                2020   | Eva    |   Cherries
                                 2020   | Frey   |   Banana
                                 2018   | Ali    |   Apple

```

The code that doesn't work:

```
i=0
for i in range(3):
    df1['2018'] = len(df2.loc[df2['fruit_farmed'] == df1['Fruit_Name'][i]])
    df1['2019'] = len(df2.loc[df2['fruit_farmed'] == df1['Fruit_Name'][i]])
    df1['2020'] = len(df2.loc[df2['fruit_farmed'] == df1['Fruit_Name'][i]])
    i=i+1

Output:
    No  Fruit_Name  2018    2019    2020
0   1      Apple     1        1      1
1   2      Banana    1        1      1
2   3     Cherries   1        1      1

```