Microsoft introduced Python support from Power BI on August 2018 update.
PowerBI is supporting R visuals and PowerBI producing custom R visuals too. PowerBI team extended the data science capability of PowerBI by supporting python.
In this post, I am explaining the simple python plot in Power BI.
Download the latest version of Power BI. As python support in preview support, we need to enable the python support preview feature.
You should install the Python on your machine so that you can point the python home directory which is mandatory to run any python scripts inside PowerBI.
Once you have configured the setup then you need to test with simple code. Use the below code.
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 3*4, 500)
The above code works perfectly and produced the plot on jupyter notebook and need to get the same result on PowerBI also.
Drag and drop the python visual into the canvas area. In the below script editor, reference any dummy column and then copy and paste the above script.
Finally, execute the script and it will produce the plot as like below.
Now, you can play with your python scripts.