Sorting data frames with time in hours days months format
Firstly you have to assert the type of data you have in your dataframe.
This will indicate how you may proceed.
df.dtypes  or at your case df.index.dtypes .
Preferred option for sorting dataframes is  df.sort_values()
I have one data frame with time in columns but not sorted order, I want to sort in ascending order, can some one suggest any direct function or code for data frames sort time.
My input data frame:




Time
data1




1 month
43.391588


13 h
31.548372


14 months
41.956652


3.5 h
31.847388




Expected data frame:




Time
data1




3.5 h
31.847388


13 h
31.847388


1 month
43.391588


14 months
41.956652