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!
| User | Count |
|---|---|
| 64 | |
| 47 | |
| 41 | |
| 36 | |
| 23 |
| User | Count |
|---|---|
| 185 | |
| 123 | |
| 106 | |
| 78 | |
| 52 |