How to assign new values to Dataset?
{'login': 'beyondguo', 'id': 37113676, 'node_id': 'MDQ6VXNlcjM3MTEzNjc2', 'avatar_url': 'https://avatars.githubusercontent.com/u/37113676?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/beyondguo', 'html_url': 'https://github.com/beyondguo', 'followers_url': 'https://api.github.com/users/beyondguo/followers', 'following_url': 'https://api.github.com/users/beyondguo/following{/other_user}', 'gists_url': 'https://api.github.com/users/beyondguo/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/beyondguo/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/beyondguo/subscriptions', 'organizations_url': 'https://api.github.com/users/beyondguo/orgs', 'repos_url': 'https://api.github.com/users/beyondguo/repos', 'events_url': 'https://api.github.com/users/beyondguo/events{/privacy}', 'received_events_url': 'https://api.github.com/users/beyondguo/received_events', 'type': 'User', 'site_admin': False}
[{'id': 1935892871, 'node_id': 'MDU6TGFiZWwxOTM1ODkyODcx', 'url': 'https://api.github.com/repos/huggingface/datasets/labels/enhancement', 'name': 'enhancement', 'color': 'a2eeef', 'default': True, 'description': 'New feature or request'}]
[]
Hi! One option is use `map` with a function that overwrites the labels (`dset = dset.map(lamba _: {"label": 0}, features=dset.features`)). Or you can use the `remove_column` + `add_column` combination (`dset = dset.remove_columns("label").add_column("label", [0]*len(data)).cast(dset.features)`, but note that this approach creates an in-memory table for the added column instead of writing to disk, which could be problematic for large datasets. Hi! I tried your proposed solution, but it does not solve my problem unfortunately. I am working with a set of protein sequences that have been tokenized with ESM, but some sequences are longer than `max_length`, they have been truncated in the tokenization. So now I want to truncate my labels as well, but that does not work with a mapping (e.g. `dset.map` as you suggested). Specifically, what I did was the following:

```
def postprocess_tokenize(tokenized_data):
    """
    adjust label lengths if they dont match.
    """
    if len(tokenized_data['input_ids']) < len(tokenized_data['labels']):
        new_labels = tokenized_data['labels'][:len(tokenized_data['input_ids'])]
        tokenized_data["labels"] = new_labels
    return tokenized_data

tokenized_data = tokenized_data.map(postprocess_tokenize, batched=True) # this does not adjust the labels...
```

Any tips on how to do this properly?

More generally, I am wondering why the DataCollator supports padding but does not support truncation? Seems odd to me.

Thanks in advance!
![image](https://user-images.githubusercontent.com/37113676/179149159-bbbda0c8-a661-403c-87ed-dc2b4219cd68.png)

Hi, if I want to change some values of the dataset, or add new columns to it, how can I do it?

For example, I want to change all the labels of the SST2 dataset to `0`:
```python
from datasets import load_dataset
data = load_dataset('glue','sst2')

data['train']['label'] = [0]*len(data)
```

I will get the error:
```
TypeError: 'Dataset' object does not support item assignment
```
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/4684/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}