# How do I create a new DataFrame from another Dataframe by removing certain columns

**URL:** <https://discourse.julialang.org/t/how-do-i-create-a-new-dataframe-from-another-dataframe-by-removing-certain-columns/59642>\
**Category:** New to Julia\
**Created:** [April 20, 2021, 7:05am UTC](https://discourse.julialang.org/t/how-do-i-create-a-new-dataframe-from-another-dataframe-by-removing-certain-columns/59642 "2021-04-20T07:05:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nash](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nash/32/14482_2.png) [@Nash](https://discourse.julialang.org/u/Nash)\
**Post date:** [April 20, 2021, 7:05am UTC](https://discourse.julialang.org/t/how-do-i-create-a-new-dataframe-from-another-dataframe-by-removing-certain-columns/59642/1 "2021-04-20T07:05:27Z")

</div>

I wish to create a new DataFrame from another Dataframe by removing certain columns.

I was hoping the following simple syntax would work, but I get the error “**MethodError: no method matching InvertedIndex(::Symbol, ::Symbol)**”

```
select!(df, Not(:col1,:col4, col7))

```

What is the correct way to achieve my aim?

---

<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:** [April 20, 2021, 7:10am UTC](https://discourse.julialang.org/t/how-do-i-create-a-new-dataframe-from-another-dataframe-by-removing-certain-columns/59642/2 "2021-04-20T07:10:34Z")

</div>

`select(df, Not([:col1,:col4, :col7]))` if you want to create a new data frame.
