I have a dataframe called OutputDf that looks like:
Date Last Price Type
1928 02/07/2010 0.00 missing value
1952 31/05/2010 NaN missing value
1972 03/05/2010 NaN missing value
2048 13/01/2010 0.00 missing value
659 10/06/2015 402.70 outlier
1020 13/01/2014 471.15 outlier
1309 23/11/2012 492.14 outlier
1698 26/05/2011 404.99 outlier
2057 30/12/2009 476.86 outlier
I am sorting the dataframe by the Date field using:
OutputDf = OutputDf.ix[pd.to_datetime(OutputDf.Date).order().index]
However I am getting future warning:
FutureWarning: order is deprecated, use sort_values(...)
I have tried to change to using sort_values() as suggested by implementing:
OutputDf = OutputDf.sort_values("Date", ascending = True,
inplace = True)
but I get None returned.
The desired output will be sorted by date (ascending) and would look like:
Date Last Price Type
2057 30/12/2009 476.86 outlier
2048 13/01/2010 0 missing values
1972 03/05/2010 NaN missing values
1952 31/05/2010 NaN missing values
1928 02/07/2010 0 missing values
1698 26/05/2011 404.99 outlier
1309 23/11/2012 492.14 outlier
1020 13/01/2014 471.15 outlier
659 10/06/2015 402.7 outlier
How can I implement sort_values correctly?
inplace=Trueand did a reassignment back to the same name. Pick one, but don't use both