I have a pandas dataframe with a hash in one column and dates in another column. I want to create a new column with age, i.e., difference between the first date with a particular hash and the current date. As an example, the dataframe `inf` contains

```
inf.head(5)
                                   id       date
0  00047331-29e7-4165-833f-3efcfc2ea90f 2015-08-19
1  0005b350-31ac-443c-8244-21a34120c83d 2015-08-20
2  0007da63-6fa6-4c0d-a1b1-b09fb0353853 2015-08-10
3  0007da63-6fa6-4c0d-a1b1-b09fb0353853 2015-08-07
4  0007da63-6fa6-4c0d-a1b1-b09fb0353853 2015-08-04

```

I add a column called age to this by 

```
inf['age'] = pd.Series(np.zeros(len(inf)), index=inf.index)

```

Now I want to convert this to 

```
                               id       date  age
0  00047331-29e7-4165-833f-3efcfc2ea90f 2015-08-19    0
1  0005b350-31ac-443c-8244-21a34120c83d 2015-08-20    0
2  0007da63-6fa6-4c0d-a1b1-b09fb0353853 2015-08-10    0
3  0007da63-6fa6-4c0d-a1b1-b09fb0353853 2015-08-07    -3
4  0007da63-6fa6-4c0d-a1b1-b09fb0353853 2015-08-04    -6

```

Where the last column is the difference between a particular id's first date and the date in that row. I am currently using this to perform this:

```
datedict={}
for count in range(len(inf)):
    try:
        inf['age'][count]=inf['date'][count]-datedict[inf['id'][count]]
    except KeyError:
        datedict[inf['udid'][count]]=inf['date'][count]

```

This is working but is disgustingly slow. Took over an hour for 100,000 records. Is there a better way to perform this?