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.
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!
hey, thank you for your help.
where exactly do you convert the x into str?
do you use .astype(str)?
Kind regards
Hendrik
@@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.
This was really helpful, this string issue solved my error. many thanks!
@@ced4030 heyy thank u so much! this helped!!
@@rashmikrishnamohan1736 my pleasure!
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
when i run, i get 1 or 0 or -1.
I don't get decimals, why?
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?
Yes you can apply that function to new column. Line 13 is creating a column of results
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?
Make sure you have Python installed and Power BI connected to it's source.
isnt it 0.05?
When I try to change the polarity scores to a decimal I get an error.
I'm assuming this happens on the Power BI edit queries section. Id try to filter your column to see if there are any issues before conversion.
@@absentdata Thank you
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 might solve your problem: community.powerbi.com/t5/Desktop/Message-ErrorCode-2147467259/td-p/775959
Would u please provide the dataset link for follow? Thanks
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
However, it is working well with python where i am using Spyder
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.
Great video! thanks a lot
Save 😍