@@ -644,7 +644,7 @@ describe("DataFrame", function () {
644644 let data = [ [ 0 , 2 , 4 ] , [ 360 , 180 , 360 ] ] ;
645645 let df = new DataFrame ( data , { columns : [ "col1" , "col2" , "col3" ] } ) ;
646646 assert . deepEqual ( df . mean ( ) . values , [ 180 , 91 , 182 ] ) ;
647- assert . deepEqual ( df . mean ( ) . index , [ "col1" , "col2" , "col3" ] ) ;
647+ assert . deepEqual ( df . mean ( ) . index , [ "col1" , "col2" , "col3" ] ) ;
648648
649649 } ) ;
650650 it ( "Return mean of a DataFrame along axis 0 (row)" , function ( ) {
@@ -1431,6 +1431,17 @@ describe("DataFrame", function () {
14311431 assert . deepEqual ( df . values , df_val ) ;
14321432
14331433 } ) ;
1434+ it ( "drop works for undefined values" , function ( ) {
1435+ let data = [ [ null , 1 , 2 , 3 ] , [ 3 , 4 , undefined , 9 ] , [ 5 , 6 , 7 , 8 ] ] ;
1436+ let column = [ "A" , "B" , "C" , "D" ] ;
1437+ let df = new DataFrame ( data , { columns : column } ) ;
1438+
1439+ let df_val = [ [ 5 , 6 , 7 , 8 ] ] ;
1440+
1441+ df . dropna ( 0 , { inplace : true } ) ;
1442+ assert . deepEqual ( df . values , df_val ) ;
1443+
1444+ } ) ;
14341445 } ) ;
14351446
14361447 describe ( "isna" , function ( ) {
@@ -2068,6 +2079,17 @@ describe("DataFrame", function () {
20682079 let rslt = [ [ 2 , 4 , 6 , 'c' ] , [ 0 , 2 , 4 , 'b' ] , [ 360 , 180 , 360 , 'a' ] ] ;
20692080 assert . deepEqual ( df . values , rslt ) ;
20702081 } ) ;
2082+ it ( "sort index in descending order and retains index" , function ( ) {
2083+ let data = [ [ 0 , 2 , 4 , "b" ] ,
2084+ [ 360 , 180 , 360 , "a" ] ,
2085+ [ 2 , 4 , 6 , "c" ] ] ;
2086+
2087+ let df = new DataFrame ( data , { "columns" : [ "col1" , "col2" , "col3" , "col4" ] , index : [ "b" , "a" , "c" ] } ) ;
2088+ let df2 = df . sort_index ( { ascending : false } ) ;
2089+ let rslt = [ "c" , "b" , "a" ] ;
2090+
2091+ assert . deepEqual ( df2 . index , rslt ) ;
2092+ } ) ;
20712093 } ) ;
20722094
20732095 describe ( "append" , function ( ) {
0 commit comments