I have a CSV dataset with the 'date' attribute as follows:

> 
> 2012-04-29
> 
> 
> 2012-04-29
> 
> 
> 2012-04-29
> 
> 
> 2012-05-05
> 
> 
> 2012-05-05
> 
> 
> Name: date, dtype: datetime64[ns]
> 
> 
> 

I want to convert the unique date values to integer values. So the first 3 values for same date '2012-04-29' become 1, the second two values for same date '2012-05-05' becomes 2 and so on.

How can I do this conversion of 'date' attribute to a new integer attribute/column say 'date\_int'?

Thanks