#NEWLINE# def test_sort_datetimes( self ) : #NEWLINE# #INDENT# df = DataFrame ( [ 'a' , 'a' , 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'g' ] , columns = [ 'A' ] , index = date_range ( '20130101' , periods = 9 ) ) #NEWLINE# dts = [ Timestamp ( x ) for x in [ '2004-02-11' , '2004-01-21' , '2004-01-26' , '2005-09-20' , '2010-10-04' , '2009-05-12' , '2008-11-12' , '2010-09-28' , '2010-09-28' ] ] #NEWLINE# df [ 'B' ] = ( dts [ : : 2 ] + dts [ 1 : : 2 ] ) #NEWLINE# df [ 'C' ] = 2.0 #NEWLINE# df [ 'A1' ] = 3.0 #NEWLINE# df1 = df . sort_values ( by = 'A' ) #NEWLINE# df2 = df . sort_values ( by = [ 'A' ] ) #NEWLINE# assert_frame_equal ( df1 , df2 ) #NEWLINE# df1 = df . sort_values ( by = 'B' ) #NEWLINE# df2 = df . sort_values ( by = [ 'B' ] ) #NEWLINE# assert_frame_equal ( df1 , df2 )