I have a pandas Series in which the data is datetime type. I would like to convert it into a unique integer index. I am looking for a direct, fast command, as the data is big.
Example:
0
0 2015-07-05
1 2015-07-12
3 2015-07-19
4 2015-07-12
Should be converted to:
0
0 1
1 2
3 3
4 2
In fact, I am also wondering whether there is a general purpose command, that converts a series of any data type into a series of unique integers in this way.