I would like to create a function to do this...so I don't have to retype this several times based on different column names. I have a data frame that looks like this (except with 1500 rows and a few extra columns):

| Application Name | Device Type | DAU | MAU | Downloads |
| --- | --- | --- | --- | --- |
| App 3 | iOS | 5000 | 50000 | 100000 |
| App 3 | Android | 4700 | 90000 | 120000 |
| App 7 | iOS | 12000 | 45000 | 77890 |
| App 7 | Android | 17000 | 60000 | 66000 |

My goal is to turn the following code below into a function. I need to be able to multiply every row where the device type is iOS by one number, and every row that the Device Type is Android by a different number.

Then I'll need to do the same for MAU, Downloads and a few other columns. So I'd like to make this into a function to reduce repetitive code.

```
df["Guess"]=pd.NaT
df["Guess"]=df['Guess'].mask(df['Device Type']=='iOS', df['DAU']*0.333)
df["Guess"]=df['Guess'].mask(df['Device Type']=='Android', df['DAU']*0.312)

```

I also know I could use something like:

```
df.loc[df['Device Type'] == 'iOS']

```

But now sure which is the best way to deal with performing some action on a data frame based on a value in a row.