# remove-columns

## Description

The <mark style="color:purple;">`remove-columns`</mark> *adaptor is used to exclude specified columns from a datatable*.

## Inputs

**`data`**\
Type: `datatable`\
Required: Yes\
The datatable containing the columns to be removed.

**`columns`**\
Type: `list`\
Required: Yes\
The list of columns to be removed.

## Outputs

**`data`**\
Type: `datatable`\
A datatable with the specified columns removed.

## Examples

### Example 1: Default behaviour.

Inputs:

`data`:

<table><thead><tr><th width="103">Year</th><th width="88">Month</th><th width="129">Sales (USD)</th><th width="122">Sales (GBP)</th><th width="127">Sales (EUR)</th></tr></thead><tbody><tr><td>2020</td><td>Jan</td><td>1458</td><td>1156</td><td>1345</td></tr><tr><td>2020</td><td>Feb</td><td>9874</td><td>7835</td><td>9110</td></tr><tr><td>2020</td><td>Mar</td><td>4562</td><td>3601</td><td>4173</td></tr><tr><td>2020</td><td>Apr</td><td>3654</td><td>2885</td><td>3342</td></tr></tbody></table>

`columns`:

1. Sales (USD)
2. Sales (GBP)
3. Sales (EUR)

#### Outputs:

`data`:

<table><thead><tr><th width="103">Year</th><th width="88">Month</th></tr></thead><tbody><tr><td>2020</td><td>Jan</td></tr><tr><td>2020</td><td>Feb</td></tr><tr><td>2020</td><td>Mar</td></tr><tr><td>2020</td><td>Apr</td></tr></tbody></table>

-> Removed columns `Sales (USD)`, `Sales (GBP)`, `Sales (EUR)` from the datatable.

## Use Cases

* Clean up data to keep essential columns.
* Remove columns including sensitive information for data sharing.
* Remove unwanted columns after using the [<mark style="color:purple;">`split-column`</mark>](https://cgps.gitbook.io/data-flo/reference-guide/split-column) adapter.
