dropColumns
The dropColumns
method creates a table with the same number of rows as the source table but omits any columns included in the arguments.
Syntax
table.dropColumns(columnNames...)
Parameters
Parameter | Type | Description |
---|---|---|
columnNames | String... | Columns that will be omitted in the new table. |
columnNames | Collection<String> | Columns that will be omitted in the new table. |
columnNames | ColumnName... | Columns that will be omitted in the new table. |
Returns
A new table that includes the same number of rows as the source table, with the specified column names omitted.
Examples
source = newTable(
stringCol("A", "apple", "apple", "orange", "orange", "plum", "plum"),
intCol("B", 1, 1, 2, 2, 3, 3),
stringCol("C", "Macoun", "Opal", "Navel", "Cara Cara ", "Greengage", "Mirabelle"),
intCol("D", 1, 2, 12, 3, 2, 3)
)
result = source.dropColumns("B","D")
- source
- result