Forum Discussion
Jeanxyz
2 years agoPower Participant
get data via python script
I'm learning to import data via python script following Microsoft tutorial (https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-python-scripts). I have installed python, pandas, matplotli...
- 2 years ago
works fine for me. Re-do your Python setup on that PC.
No need to print the variable.
let Source = Python.Execute("import pandas as pd#(lf)data = [['Alex',10],['Bob',12],['Clarke',13]]#(lf)df = pd.DataFrame(data,columns=['Name','Age'])"), df1 = Source{[Name="df"]}[Value] in df1
Jeanxyz
1 year agoPower Participant
As an addition to the discussion above, I found out later that Power BI only support very limited python package, so even if a python script works in PB Desktop, it may still fail to refresh after publishing to PB Service. So a real solution should be create the python script in Fabric Notebook and import data from Fabric to Power BI Desktop.