Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hola
Estoy usando Power BI Desktop e intentando hacer un análisis sentimental con el siguiente código python:
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']
Cuando ejecuto esto en PowerQuery->Secuencia de comandos de Python, obteré este error:
DataSource.Error: ADO.NET: error de script de Python. |
¿Puede alguien ayudarme a averiguar cuál es el problema?
Solved! Go to Solution.
HI @michaelbend ,
Cuando prueba la secuencia de comandos de Python por python 3.9.Then :
Parece haber un problema con el guión en sí.
SyntaxError: EOF inesperado durante el análisis
¡Ojalá sea útil para ti!
Saludos
Lucien
Tal vez pueda ayudarte, estoy familiarizado con la programación de Python en Power BI.
Puedes contactarme en: xiaoqing.gao@cn.abb.com
HI @michaelbend ,
Cuando prueba la secuencia de comandos de Python por python 3.9.Then :
Parece haber un problema con el guión en sí.
SyntaxError: EOF inesperado durante el análisis
¡Ojalá sea útil para ti!
Saludos
Lucien
¿No hay respuesta?
chichón
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 |