I have a dataframe `df` that has following values:

```
           activityType activity_preferance
userID      
agashi1996  joinClub    Nan
agashi1998  post        Nan
agashi1998  post        Nan
agashi1998  post        Nan
agashi1994  followuser  Nan

```

The `userID` column is the index here.

I want to fill the column `activity_preferance` with 1,2 and 3 if `activityType` is `joinClub`, `post`, `followuser` respectively.

I wrote this code:

```
for i,row in df_activity_filter.iterrows():
    if (df_activity_filter.loc[i,'activityType'] == 'joinClub'):
        df_activity_filter.loc[i,'activity_preferance'] = 1
    elif (df_activity_filter.loc[i,'activityType'] == 'post'):
        df_activity_filter.loc[i,'activity_preferance'] = 2
    elif (df_activity_filter.loc[i,'activityType'] == 'followuser'):
        df_activity_filter.loc[i,'activity_preferance'] = 3

```

I am getting the error:

`ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().`

The desired dataframe/output should be like this:

```
           activityType activity_preferance
userID      
agashi1996  joinClub    1
agashi1998  post        2
agashi1998  post        2
agashi1998  post        2
agashi1994  followuser  3

```

Any help on this?