public FiveNumSummary[] getFiveNumSummary() throws DDFException { return this.getStatisticsSupporter().getFiveNumSummary(this.getColumnNames()); }
List<String> rightColumns = anotherDDF.getColumnNames(); List<String> leftColumns = getDDF().getColumnNames();
@Override public DDF removeColumns(List<String> columnNames) throws DDFException { if (columnNames == null || columnNames.isEmpty()) throw new DDFException("columnNames must be specified"); List<String> currentColumnNames = this.getDDF().getColumnNames(); for(String columnName: columnNames) { if(!currentColumnNames.contains(columnName)) { throw new DDFException(String.format("Column %s does not exists", columnName)); } } List<String> columns = this.getDDF().getColumnNames(); for (String columnName : columnNames) { for (Iterator<String> it = columns.iterator();it.hasNext();) { if (it.next().equals(columnName)) { it.remove(); } } } DDF newddf = this.project(columns); if(this.getDDF().isMutable()) { this.getDDF().updateInplace(newddf); return this.getDDF(); } else { newddf.getMetaDataHandler().copyFactor(this.getDDF()); return newddf; } }
@Override public DDF subset(List<Column> columnExpr, Expression filter) throws DDFException { DDF subset = _subset(columnExpr, filter); subset.getMetaDataHandler().copyFactor(this.getDDF(), this.getDDF().getColumnNames()); return subset; }
StringBuffer caseCmd = new StringBuffer(""); List<String> columns = this.getDDF().getColumnNames();
@Test public void testInnerJoin() throws DDFException { DDF ddf = left_ddf.join(right_ddf, JoinType.INNER, Arrays.asList("cyl"),null,null); LOG.info("Column names: " +ddf.getColumnNames()); Assert.assertEquals(25, ddf.getNumRows()); }
/** * This function fills NA with given values. Default using a scalar value fillNA(value,null, 0, null, null, null, * false) * * @param value a scalar value to fill all NAs * @param method = 'ffill' for forward fill or 'bfill' for backward fill * @param limit = maximum size gap for forward or backward fill * @param function aggregate function to generate the filled value for a column * @param columnsToValues = a map to provide different values to fill for different columns * @param columns = only consider NA filling on the given columns, set to null for all columns of the DDF * @return a DDF with NAs filled */ @Override public DDF fillNA(String value, FillMethod method, long limit, AggregateFunction function, Map<String, String> columnsToValues, List<String> columns) throws DDFException { DDF newddf = null; if (columns == null) { columns = this.getDDF().getColumnNames(); } if (method == null) { String sqlCmd = fillNAWithValueSQL(value, function, columnsToValues, columns); mLog.info("FillNA sql command: " + sqlCmd); newddf = this.getManager().sql2ddf(String.format(sqlCmd, this.getDDF().getTableName()), false); } else { // interpolation methods 'ffill' or 'bfill' // TODO: } newddf.getMetaDataHandler().copyFactor(this.getDDF()); return newddf; }
columns = this.getDDF().getColumnNames();