# Encode\_plus Pretokenized input seuqence must be Union

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fencode-plus-pretokenized-input-seuqence-must-be-union%2F26449%3E%5C
**Category:** 🤗Tokenizers\
**Created:** [November 21, 2022, 2:19pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fencode-plus-pretokenized-input-seuqence-must-be-union%2F26449 "2022-11-21T14:19:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adelija](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@Adelija](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FAdelija)%5C
**Post date:** [November 21, 2022, 2:19pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fencode-plus-pretokenized-input-seuqence-must-be-union%2F26449%2F1 "2022-11-21T14:19:11Z")

</div>

Hello,  
I have a problem with arguments types for the encode\_plus method.

The code works when we put, for example, df[‘labels’][0] or any other index (so when it is list of strings), but not with the whole column (df[‘labels’].to\_list(), so when it is list of lists of strings).

We need to tokenize the whole data frame, so our question is - is there another function that can do that, or we need to iterate through the data frame and call encode\_plus() on each separate cell value?

 ![MicrosoftTeams-image](https://us1.discourse-cdn.com/hellohellohello/original/2X/c/c725e9f81caa160e9c30fada2dd39cbb790104d2.jpeg)

Thanks
