You can use Natural Language Processing Toolkit to quickly get sentiment scores on text like comments or tweets. You can check out the full written instructions here:
Very helpful vid so thanks for making it! I ran into some errors along the way with both python and power bi but googling helped solve those. To save others some trouble: 1. in python, you may have to convert your 'x' variable to a string inside of the lambda function if your read command doesn't auto convert to that type. 2. your dataframe must be labeled to dataset as in the video. df doesnt work since powerbi is expecting dataset specifically. 3. make sure your python options in the desktop are infact set to your python installation. by default mines was set to an old installation. Hope that helps the folks after me!
@@HendrikTuc It has been a while since I have used this code, but i believe it was something like lambda x: sia.polarity_scores(str(x)) - no need for astype(str) inside the lambda anyways. Because lambda x means that x is referencing each row of the dataframe.
Hi in spyder i have to use Dataset= pd.read.excel('filename.xlsx',encoding = 'utf-8').astype(str) What will i jave to do that in power bi for this I am very new to python code learnt using ur videos Thanks
if I wanted to run against more than 1 column, do I repeat line 13: dataset = dataset.apply etc. for each column creating a new column for each line of code?
DataSource.Error: ADO.NET: Python script error. Traceback (most recent call last): File "PythonScriptWrapper.PY", line 2, in import os, pandas, matplotlib File "C:\USERS\JASON\ANACONDA3\lib\site-packages\pandas\__init__.py", line 17, in "Unable to import required dependencies: " + " ".join(missing_dependencies) ImportError: Unable to import required dependencies: numpy: DLL load failed: The specified module could not be found. Details: I get this error when I try to run the python script. what is happening?
Getting this error - DataSource.Error: ADO.NET: A problem occurred while processing your Python script. Here are the technical details: Process must exit before requested information can be determined. Details: DataSourceKind=Python DataSourcePath=Python Message=A problem occurred while processing your Python script. Here are the technical details: Process must exit before requested information can be determined. ErrorCode=-2147467259 ExceptionType=Microsoft.PowerBI.Scripting.Python.Exceptions.PythonUnexpectedException What can be the issue?
This is very excellent tutorial but when i am following your video, my power bi is showing the following error: DataSource.Error: ADO.NET: Python script error. Traceback (most recent call last): File "PythonScriptWrapper.PY", line 19, in mydataset['polairty scores'] =mydataset['Message'].apply(lambda x: sia.polarity_scores(x)['compound']) NameError: name 'mydataset' is not defined Details: DataSourceKind=Python DataSourcePath=Python Message=Python script error. Traceback (most recent call last): File "PythonScriptWrapper.PY", line 19, in mydataset['polairty scores'] =mydataset['Message'].apply(lambda x: sia.polarity_scores(x)['compound']) NameError: name 'mydataset' is not defined ErrorCode=-2147467259 ExceptionType=Microsoft.PowerBI.Scripting.Python.Exceptions.PythonScriptRuntimeException
You shouldn't be creating a new variable called 'mydataset'. Research the video. Power BI creates a default variable called dataset. You can see this in notation when opening the script editor.