Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi!
I'm trying to translate a column of my table, using Python's TextBlob library. this is my code.
from textblob import TextBlob
def translation(text):
blob = TextBlob(text)
return str(blob.translate(from_lang = 'pt', to = 'en'))
dataset['translation'] = dataset['CardDescription'].apply(translation)
it generates the following error.
TypeError: The `text` argument passed to `__init__(text)` must be a string, not <class 'float'>
however my CardDescription column is formatted as text.
I tested it using a string variable and it worked.
I don't know the reason for the error, can someone help me?
Thanks in advance!
Hi, @vgferreira
This is an error message related to the python script, not powerbi.
You should check the encoding you are using for your file.
Reference:
TextBlob --- The `text` argument passed to `__init__(text)` must be a string, not <class 'float'>
Best Regards,
Community Support Team _ Eason
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 46 |