static Frame uniqueValuesBy ( Frame fr , int columnIndex ) { Vec vec0 = fr . vec ( columnIndex ) ; Vec v ; if ( vec0 . isCategorical ( ) ) { v = Vec . makeSeq ( 0 , ( long ) vec0 . domain ( ) . length , true ) ; v . setDomain ( vec0 . domain ( ) ) ; DKV . put ( v ) ; } else { UniqTask t = new UniqTask ( ) . doAll ( vec0 ) ; int nUniq = t . _uniq . size ( ) ; final AstGroup . G [ ] uniq = t . _uniq . keySet ( ) . toArray ( new AstGroup . G [ nUniq ] ) ; v = Vec . makeZero ( nUniq , vec0 . get_type ( ) ) ; new MRTask ( ) { @ Override public void map ( Chunk c ) { int start = ( int ) c . start ( ) ; for ( int i = 0 ; i < c . _len ; ++ i ) c . set ( i , uniq [ i + start ] . _gs [ 0 ] ) ; } } . doAll ( v ) ; } return new Frame ( v ) ; }
return a frame with unique values from the specified column