Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi there,
I'm using Power BI Desktop and trying to make a sentimental analysis with the following python code:
import pandas as pd
from nltk.sentiment.vader import SentimentIntensityAnalyzer
import re
from googletrans import Translator
translatedList = []
for index, row in dataset.iterrows():
translator = Translator()
newrow = copy.deepcopy(row)
try:
translated = translator.translate(row['zin'], dest='en')
newrow['translated'] = translated.text
except Exception as e:
print(e)
continue
translatedList.append(newrow)
dataset_new = pd.DataFrame(translatedList)
SentimentAnalysis = SentimentIntensityAnalyzer()
dataset['sentiment score'] = dataset['translated'].apply(lambda x: SentimentAnalysis.polarity_scores(x)['compound']
When I run this in PowerQuery->Python Script, I get this error:
DataSource.Error: ADO.NET: Python script error. |
Can someone help me figuring out what the problem is?
Solved! Go to Solution.
HI @Anonymous ,
When I test your python script by python 3.9.Then :
There seems to be a problem with the script itself.
SyntaxError: unexpected EOF while parsing
Wish it is helpful for you!
Best Regards
Lucien
Maybe I can help you, I'm familiar with python programming in Power BI.
You can contact me at: xiaoqing.gao@cn.abb.com
HI @Anonymous ,
When I test your python script by python 3.9.Then :
There seems to be a problem with the script itself.
SyntaxError: unexpected EOF while parsing
Wish it is helpful for you!
Best Regards
Lucien
No answer?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
76 | |
73 | |
42 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
42 |