I have a date column in a python dataframe. I want to index these by ordering the date. Is this something possible in python?
date indexed
2007-02-21 3
2007-02-18 1
2007-02-24 5
2007-02-18 1
2007-02-23 4
2007-02-20 2
2007-02-23 4
I was looking for indexation, but i guess i am using a wrong term to check for. Please guide.
Edit
Actually i want to replace the dates by the equivalent index numbers.


df.sort_values(by='Date')