# AttributeError: 'Dataset' object has no attribute 'remove\_columns'

**URL:** <https://discuss.huggingface.co/t/attributeerror-dataset-object-has-no-attribute-remove-columns/15231>\
**Category:** Beginners\
**Created:** [March 1, 2022, 5:36pm UTC](https://discuss.huggingface.co/t/attributeerror-dataset-object-has-no-attribute-remove-columns/15231 "2022-03-01T17:36:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArnauC](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@ArnauC](https://discuss.huggingface.co/u/ArnauC)\
**Post date:** [March 1, 2022, 5:36pm UTC](https://discuss.huggingface.co/t/attributeerror-dataset-object-has-no-attribute-remove-columns/15231/1 "2022-03-01T17:36:17Z")

</div>

Hi, I’m trying to remove a column of a huggingface dataset and I keep getting this message:  
AttributeError: ‘Dataset’ object has no attribute ‘remove\_columns’

The code:

```auto
from datasets import load_dataset

raw_datasets = load_dataset("glue", "mrpc")

raw_datasets['train'].remove_columns("sentence1")

```

I don’t get it, everywhere seems to point out this is the correct way but…

What am I missing?  
Thank you guys

---

<div class="post-metadata">

**Author:** ![lhoestq](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lhoestq/32/52888_2.png) [@lhoestq](https://discuss.huggingface.co/u/lhoestq)\
**Post date:** [March 2, 2022, 10:41am UTC](https://discuss.huggingface.co/t/attributeerror-dataset-object-has-no-attribute-remove-columns/15231/2 "2022-03-02T10:41:00Z")

</div>

Hi ! It works fine on my side. What version of `datasets` are you using ?

---

<div class="post-metadata">

**Author:** ![ArnauC](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@ArnauC](https://discuss.huggingface.co/u/ArnauC)\
**Post date:** [March 2, 2022, 11:08am UTC](https://discuss.huggingface.co/t/attributeerror-dataset-object-has-no-attribute-remove-columns/15231/3 "2022-03-02T11:08:24Z")

</div>

Hi! I just solved it, it was indeed a problem of versions. I was using 1.0.1. With 1.14.0 it works fine.  
Thanks!

---

<div class="post-metadata">

**Author:** ![OmarMaher](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/omarmaher/32/18701_2.png) [@OmarMaher](https://discuss.huggingface.co/u/OmarMaher)\
**Post date:** [August 20, 2023, 7:34am UTC](https://discuss.huggingface.co/t/attributeerror-dataset-object-has-no-attribute-remove-columns/15231/4 "2023-08-20T07:34:29Z")

</div>

You can use this line to solve it  
df= df.remove\_columns([“column\_name”])
