# How to remove columns from Dataframe

**URL:** <https://discourse.julialang.org/t/how-to-remove-columns-from-dataframe/82459>\
**Category:** General Usage\
**Tags:** dataframes\
**Created:** [June 8, 2022, 7:30pm UTC](https://discourse.julialang.org/t/how-to-remove-columns-from-dataframe/82459 "2022-06-08T19:30:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bicepjai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bicepjai/32/18158_2.png) [@bicepjai](https://discourse.julialang.org/u/bicepjai)\
**Post date:** [June 8, 2022, 7:30pm UTC](https://discourse.julialang.org/t/how-to-remove-columns-from-dataframe/82459/1 "2022-06-08T19:30:59Z")

</div>

I have a parquet dataset with 32 million rows read using `read_parquet`  
Complex processing gets completed in seconds.

But when I try to ignore some columns using  
`select!(data, Not([:column1, :column2]))`

This does not complete even after a day. What is the best way to remove columns without copying the whole data frame. will try to come up with generic eg.

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [June 8, 2022, 7:37pm UTC](https://discourse.julialang.org/t/how-to-remove-columns-from-dataframe/82459/2 "2022-06-08T19:37:33Z")

</div>

> [@bicepjai](#):
>
> select!(data, Not([:column1, :column2]))

This does not copy data and should be very fast. It is surprising that you have a problem here. Can you please give a reproducible example?

Here is my try:

```julia
julia> df = DataFrame(rand(Bool, 32_000_000, 100), :auto);

julia> @time select!(df, Not([:x2, :x10]));
  0.000060 seconds (165 allocations: 18.430 KiB)

```

As you can see this operation was designed to be very lightweight and fast.
