---
title: drop() function
description: drop() removes specified columns from a table.
url: https://docs.influxdata.com/flux/v0/stdlib/universe/drop/
estimated_tokens: 1258
product: Flux
version: v0
publisher: InfluxData
canonical: https://docs.influxdata.com/flux/v0/stdlib/universe/drop/
date: '2024-04-08T16:01:02-06:00'
lastmod: '2024-04-08T16:01:02-06:00'
---

* Flux 0.7.0+

InfluxDB support

`drop()` removes specified columns from a table.

Columns are specified either through a list or a predicate function.
When a dropped column is part of the group key, it is removed from the key.
If a specified column is not present in a table, the function returns an error.

##### Function type signature

```js
(<-tables: stream[A], ?columns: [string], ?fn: (column: string) => bool) => stream[B] where A: Record, B: Record
```

For more information, see [Function type signatures](/flux/v0/function-type-signatures/).

## Parameters

### columns

List of columns to remove from input tables. Mutually exclusive with `fn`.

### fn

Predicate function with a `column` parameter that returns a boolean
value indicating whether or not the column should be removed from input tables.
Mutually exclusive with `columns`.

### tables

Input data. Default is piped-forward data (`<-`).

## Examples

* [Drop a list of columns](#drop-a-list-of-columns)
* [Drop columns matching a predicate](#drop-columns-matching-a-predicate)

### Drop a list of columns

```js
import "sampledata"

sampledata.int()
    |> drop(columns: ["_time", "tag"])
```

[](#view-example-input-and-output)

View example input and output

#### Input data

|       \_time       |\_value|\*tag|
|--------------------|-------|-----|
|2021-01-01T00:00:00Z|  \-2  | t1  |
|2021-01-01T00:00:10Z|  10   | t1  |
|2021-01-01T00:00:20Z|   7   | t1  |
|2021-01-01T00:00:30Z|  17   | t1  |
|2021-01-01T00:00:40Z|  15   | t1  |
|2021-01-01T00:00:50Z|   4   | t1  |

|       \_time       |\_value|\*tag|
|--------------------|-------|-----|
|2021-01-01T00:00:00Z|  19   | t2  |
|2021-01-01T00:00:10Z|   4   | t2  |
|2021-01-01T00:00:20Z|  \-3  | t2  |
|2021-01-01T00:00:30Z|  19   | t2  |
|2021-01-01T00:00:40Z|  13   | t2  |
|2021-01-01T00:00:50Z|   1   | t2  |

#### Output data

|\_value|
|-------|
|  \-2  |
|  10   |
|   7   |
|  17   |
|  15   |
|   4   |
|  19   |
|   4   |
|  \-3  |
|  19   |
|  13   |
|   1   |

### Drop columns matching a predicate

```js
import "sampledata"

sampledata.int()
    |> drop(fn: (column) => column =~ /^t/)
```

[](#view-example-input-and-output)

View example input and output

#### Input data

|       \_time       |\_value|\*tag|
|--------------------|-------|-----|
|2021-01-01T00:00:00Z|  \-2  | t1  |
|2021-01-01T00:00:10Z|  10   | t1  |
|2021-01-01T00:00:20Z|   7   | t1  |
|2021-01-01T00:00:30Z|  17   | t1  |
|2021-01-01T00:00:40Z|  15   | t1  |
|2021-01-01T00:00:50Z|   4   | t1  |

|       \_time       |\_value|\*tag|
|--------------------|-------|-----|
|2021-01-01T00:00:00Z|  19   | t2  |
|2021-01-01T00:00:10Z|   4   | t2  |
|2021-01-01T00:00:20Z|  \-3  | t2  |
|2021-01-01T00:00:30Z|  19   | t2  |
|2021-01-01T00:00:40Z|  13   | t2  |
|2021-01-01T00:00:50Z|   1   | t2  |

#### Output data

|       \_time       |\_value|
|--------------------|-------|
|2021-01-01T00:00:00Z|  \-2  |
|2021-01-01T00:00:10Z|  10   |
|2021-01-01T00:00:20Z|   7   |
|2021-01-01T00:00:30Z|  17   |
|2021-01-01T00:00:40Z|  15   |
|2021-01-01T00:00:50Z|   4   |
|2021-01-01T00:00:00Z|  19   |
|2021-01-01T00:00:10Z|   4   |
|2021-01-01T00:00:20Z|  \-3  |
|2021-01-01T00:00:30Z|  19   |
|2021-01-01T00:00:40Z|  13   |
|2021-01-01T00:00:50Z|   1   |

#### Related

* [keep() function](/flux/v0/stdlib/universe/keep/)

[transformations](/flux/v0/tags/transformations/)
| _time | _value | *tag |
| --- | --- | --- |
| _time | _value | *tag |
| 2021-01-01T00:00:00Z | -2 | t1 |
| 2021-01-01T00:00:10Z | 10 | t1 |
| 2021-01-01T00:00:20Z | 7 | t1 |
| 2021-01-01T00:00:30Z | 17 | t1 |
| 2021-01-01T00:00:40Z | 15 | t1 |
| 2021-01-01T00:00:50Z | 4 | t1 |

| _time | _value | *tag |
| --- | --- | --- |
| _time | _value | *tag |
| 2021-01-01T00:00:00Z | 19 | t2 |
| 2021-01-01T00:00:10Z | 4 | t2 |
| 2021-01-01T00:00:20Z | -3 | t2 |
| 2021-01-01T00:00:30Z | 19 | t2 |
| 2021-01-01T00:00:40Z | 13 | t2 |
| 2021-01-01T00:00:50Z | 1 | t2 |

| _value |
| --- |
| _value |
| -2 |
| 10 |
| 7 |
| 17 |
| 15 |
| 4 |
| 19 |
| 4 |
| -3 |
| 19 |
| 13 |
| 1 |

| _time | _value | *tag |
| --- | --- | --- |
| _time | _value | *tag |
| 2021-01-01T00:00:00Z | -2 | t1 |
| 2021-01-01T00:00:10Z | 10 | t1 |
| 2021-01-01T00:00:20Z | 7 | t1 |
| 2021-01-01T00:00:30Z | 17 | t1 |
| 2021-01-01T00:00:40Z | 15 | t1 |
| 2021-01-01T00:00:50Z | 4 | t1 |

| _time | _value | *tag |
| --- | --- | --- |
| _time | _value | *tag |
| 2021-01-01T00:00:00Z | 19 | t2 |
| 2021-01-01T00:00:10Z | 4 | t2 |
| 2021-01-01T00:00:20Z | -3 | t2 |
| 2021-01-01T00:00:30Z | 19 | t2 |
| 2021-01-01T00:00:40Z | 13 | t2 |
| 2021-01-01T00:00:50Z | 1 | t2 |

| _time | _value |
| --- | --- |
| _time | _value |
| 2021-01-01T00:00:00Z | -2 |
| 2021-01-01T00:00:10Z | 10 |
| 2021-01-01T00:00:20Z | 7 |
| 2021-01-01T00:00:30Z | 17 |
| 2021-01-01T00:00:40Z | 15 |
| 2021-01-01T00:00:50Z | 4 |
| 2021-01-01T00:00:00Z | 19 |
| 2021-01-01T00:00:10Z | 4 |
| 2021-01-01T00:00:20Z | -3 |
| 2021-01-01T00:00:30Z | 19 |
| 2021-01-01T00:00:40Z | 13 |
| 2021-01-01T00:00:50Z | 1 |
