# What is replacement for Not column selection in DataFrames (inverted index) in DataFrames v0.20.0?

**URL:** <https://discourse.julialang.org/t/what-is-replacement-for-not-column-selection-in-dataframes-inverted-index-in-dataframes-v0-20-0/34823>\
**Category:** Data\
**Created:** [February 18, 2020, 6:33pm UTC](https://discourse.julialang.org/t/what-is-replacement-for-not-column-selection-in-dataframes-inverted-index-in-dataframes-v0-20-0/34823 "2020-02-18T18:33:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![js135005](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/js135005/32/8219_2.png) [@js135005](https://discourse.julialang.org/u/js135005)\
**Post date:** [February 18, 2020, 6:33pm UTC](https://discourse.julialang.org/t/what-is-replacement-for-not-column-selection-in-dataframes-inverted-index-in-dataframes-v0-20-0/34823/1 "2020-02-18T18:33:56Z")

</div>

I was making extensive of the Not function for column selection in DataFrames. However this is deprecated in v0.20.0 and I haven’t yet found how to do the equivalent in the latest documentation.

Indeed the DataFrames documentation still shows this usage:

A `Not` selector (from the [InvertedIndices](https://github.com/mbauman/InvertedIndices.jl) package) can be used to select all columns excluding a specific subset:

`df[!, Not(:x1)]`

---

<div class="post-metadata">

**Author:** ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Post date:** [February 18, 2020, 6:54pm UTC](https://discourse.julialang.org/t/what-is-replacement-for-not-column-selection-in-dataframes-inverted-index-in-dataframes-v0-20-0/34823/2 "2020-02-18T18:54:14Z")

</div>

It is Not deprecated. 😉 Get it?

But really, it’s not.

---

<div class="post-metadata">

**Author:** ![js135005](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/js135005/32/8219_2.png) [@js135005](https://discourse.julialang.org/u/js135005)\
**Post date:** [February 18, 2020, 6:54pm UTC](https://discourse.julialang.org/t/what-is-replacement-for-not-column-selection-in-dataframes-inverted-index-in-dataframes-v0-20-0/34823/3 "2020-02-18T18:54:32Z")

</div>

For numeric column index exclusion, it looks like I can replace

`select(df, Not([2,3])`

with

`select(df, vcat(1, collect(4:size(df, 2))))`

The old form is much nicer and the documentation is still wrong.

Now I need to figure out the syntax for excluding an array of symbols!

---

<div class="post-metadata">

**Author:** ![js135005](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/js135005/32/8219_2.png) [@js135005](https://discourse.julialang.org/u/js135005)\
**Post date:** [February 18, 2020, 6:59pm UTC](https://discourse.julialang.org/t/what-is-replacement-for-not-column-selection-in-dataframes-inverted-index-in-dataframes-v0-20-0/34823/4 "2020-02-18T18:59:47Z")

</div>

The notice of changes for DataFrames v0.20.0 states specifically that Not is no longer available. If I try to use it from the InvertedIndices package, it still fails.

Not still works with v0.19.x.

---

<div class="post-metadata">

**Author:** ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Post date:** [February 18, 2020, 7:01pm UTC](https://discourse.julialang.org/t/what-is-replacement-for-not-column-selection-in-dataframes-inverted-index-in-dataframes-v0-20-0/34823/5 "2020-02-18T19:01:21Z")

</div>

Too add on my previous post: InvertedIndices.jl is exactly what DataFrames.jl uses. It is re-exported by the package.

Not sure what troubles you are having but I’m on v0.20.2 and have no dep warning or anything like that. Examples like you posted work fine. Perhaps try to update?

---

<div class="post-metadata">

**Author:** ![js135005](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/js135005/32/8219_2.png) [@js135005](https://discourse.julialang.org/u/js135005)\
**Post date:** [February 18, 2020, 7:15pm UTC](https://discourse.julialang.org/t/what-is-replacement-for-not-column-selection-in-dataframes-inverted-index-in-dataframes-v0-20-0/34823/6 "2020-02-18T19:15:37Z")

</div>

Oops, looks like my DataFrames got set to v0.18.4 somehow and I had just rebuilt my environment.

I’ll force the upgrade and try again. Sorry if I’ve raised a false alarm.

---

<div class="post-metadata">

**Author:** ![js135005](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/js135005/32/8219_2.png) [@js135005](https://discourse.julialang.org/u/js135005)\
**Post date:** [February 18, 2020, 7:25pm UTC](https://discourse.julialang.org/t/what-is-replacement-for-not-column-selection-in-dataframes-inverted-index-in-dataframes-v0-20-0/34823/7 "2020-02-18T19:25:54Z")

</div>

I stand corrected. After a forced upgrade to DataFrames v0.20.2, the original syntax works nicely.

Sorry about raising a false alarm.
