I want to match a regular expression by if-else loop like this in python pandas:

```
 df=pd.read('XYZ.csv');
Total_Data=df['Description'].str.extract(r'([0-9]+(\.[0-9][0-9]?)?\sGB|[0-9]+(\.[0-9][0-9]?)?\s?MB)')[0];
df['Total_Data']=Total_Data.str.extract(r'([0-9]{1,4})')

for row in Total_Data.iteritems() :
print (type(row))
if row.str.contains(r'((?i)MB)'):
df['Total_Data']=df['Total_Data']/1000;

```

Now I know whats wrong here `contains()` is for series in pandas.But then how should I iterate through rows in `Total_Data` so that if MB word is there in `Total_Data`,I could be able to convert it into GB.I want to check this reg ex and convert those tuple data which is in MB into GB
EDIT:

Subset of my data:

```
09       NaN
10       NaN
11       NaN
12       NaN
13       300 MB
14       NaN
15       NaN
16       NaN
17        80 MB
18       125 MB
19       200 MB
20         1 GB
21       250 MB
22       400 MB
23       350 MB
24         2 GB
25       500 MB
26         1 GB
27         1 GB

```