@@ -597,32 +597,32 @@ export class DataFrame extends Ndframe {
597597 for ( let j = 1 ; j < value . length ; j ++ ) {
598598 let curr_val = value [ j ] ;
599599 switch ( ops ) {
600- case "max" :
601- if ( curr_val > temp_val ) {
602- temp_val = curr_val ;
603- temp_data . push ( curr_val ) ;
604- } else {
605- temp_data . push ( temp_val ) ;
606- }
607- break ;
608- case "min" :
609- if ( curr_val < temp_val ) {
610- temp_val = curr_val ;
611- temp_data . push ( curr_val ) ;
612- } else {
613- temp_data . push ( temp_val ) ;
614- }
615- break ;
616- case "sum" :
617- temp_val = temp_val + curr_val ;
600+ case "max" :
601+ if ( curr_val > temp_val ) {
602+ temp_val = curr_val ;
603+ temp_data . push ( curr_val ) ;
604+ } else {
618605 temp_data . push ( temp_val ) ;
619-
620- break ;
621- case "prod" :
622- temp_val = temp_val * curr_val ;
606+ }
607+ break ;
608+ case "min" :
609+ if ( curr_val < temp_val ) {
610+ temp_val = curr_val ;
611+ temp_data . push ( curr_val ) ;
612+ } else {
623613 temp_data . push ( temp_val ) ;
614+ }
615+ break ;
616+ case "sum" :
617+ temp_val = temp_val + curr_val ;
618+ temp_data . push ( temp_val ) ;
619+
620+ break ;
621+ case "prod" :
622+ temp_val = temp_val * curr_val ;
623+ temp_data . push ( temp_val ) ;
624624
625- break ;
625+ break ;
626626 }
627627 }
628628 data . push ( temp_data ) ;
@@ -1657,24 +1657,24 @@ export class DataFrame extends Ndframe {
16571657 }
16581658
16591659 switch ( logical_type ) {
1660- case "lt" :
1661- int_vals = tf . tensor ( this . values ) . less ( other ) . arraySync ( ) ;
1662- break ;
1663- case "gt" :
1664- int_vals = tf . tensor ( this . values ) . greater ( other ) . arraySync ( ) ;
1665- break ;
1666- case "le" :
1667- int_vals = tf . tensor ( this . values ) . lessEqual ( other ) . arraySync ( ) ;
1668- break ;
1669- case "ge" :
1670- int_vals = tf . tensor ( this . values ) . greaterEqual ( other ) . arraySync ( ) ;
1671- break ;
1672- case "ne" :
1673- int_vals = tf . tensor ( this . values ) . notEqual ( other ) . arraySync ( ) ;
1674- break ;
1675- case "eq" :
1676- int_vals = tf . tensor ( this . values ) . equal ( other ) . arraySync ( ) ;
1677- break ;
1660+ case "lt" :
1661+ int_vals = tf . tensor ( this . values ) . less ( other ) . arraySync ( ) ;
1662+ break ;
1663+ case "gt" :
1664+ int_vals = tf . tensor ( this . values ) . greater ( other ) . arraySync ( ) ;
1665+ break ;
1666+ case "le" :
1667+ int_vals = tf . tensor ( this . values ) . lessEqual ( other ) . arraySync ( ) ;
1668+ break ;
1669+ case "ge" :
1670+ int_vals = tf . tensor ( this . values ) . greaterEqual ( other ) . arraySync ( ) ;
1671+ break ;
1672+ case "ne" :
1673+ int_vals = tf . tensor ( this . values ) . notEqual ( other ) . arraySync ( ) ;
1674+ break ;
1675+ case "eq" :
1676+ int_vals = tf . tensor ( this . values ) . equal ( other ) . arraySync ( ) ;
1677+ break ;
16781678 }
16791679 let bool_vals = utils . __map_int_to_bool ( int_vals , 2 ) ;
16801680 let df = new DataFrame ( bool_vals , {
@@ -1846,27 +1846,27 @@ export class DataFrame extends Ndframe {
18461846 let temp_col = col_values [ col_idx ] ;
18471847
18481848 switch ( kwargs [ "dtype" ] ) {
1849- case "float32" :
1850- temp_col . map ( ( val ) => {
1851- new_col_values . push ( Number ( val ) ) ;
1852- } ) ;
1853- col_values [ col_idx ] = new_col_values ;
1854- break ;
1855- case "int32" :
1856- temp_col . map ( ( val ) => {
1857- new_col_values . push ( Number ( Number ( val ) . toFixed ( ) ) ) ;
1858- } ) ;
1859- col_values [ col_idx ] = new_col_values ;
1849+ case "float32" :
1850+ temp_col . map ( ( val ) => {
1851+ new_col_values . push ( Number ( val ) ) ;
1852+ } ) ;
1853+ col_values [ col_idx ] = new_col_values ;
1854+ break ;
1855+ case "int32" :
1856+ temp_col . map ( ( val ) => {
1857+ new_col_values . push ( Number ( Number ( val ) . toFixed ( ) ) ) ;
1858+ } ) ;
1859+ col_values [ col_idx ] = new_col_values ;
18601860
1861- break ;
1862- case "string" :
1863- temp_col . map ( ( val ) => {
1864- new_col_values . push ( String ( val ) ) ;
1865- } ) ;
1866- col_values [ col_idx ] = new_col_values ;
1867- break ;
1868- default :
1869- break ;
1861+ break ;
1862+ case "string" :
1863+ temp_col . map ( ( val ) => {
1864+ new_col_values . push ( String ( val ) ) ;
1865+ } ) ;
1866+ col_values [ col_idx ] = new_col_values ;
1867+ break ;
1868+ default :
1869+ break ;
18701870 }
18711871
18721872 let new_col_obj = { } ;
@@ -2160,7 +2160,7 @@ export class DataFrame extends Ndframe {
21602160 `length Mixmatch: The lenght of provided value (${ val . length } ) does not match the original DataFrame (${ this . shape [ 1 ] } )`
21612161 ) ;
21622162 }
2163- df2 = new DataFrame ( val ) ;
2163+ df2 = new DataFrame ( val , { columns : this . columns } ) ;
21642164 }
21652165 } else if ( utils . __is_object ( val ) ) {
21662166 df2 = new DataFrame ( val ) ;
0 commit comments