In order to use Python Visuals you need to first install Python( Anaconda or Python Version 3.5) and enable it in Power BI Desktop
Follow these steps to use Python Visuals in Query Editor:
• Load your data into Power BI Desktop
• Get Data > CSV from the Home ribbon in Power BI Desktop
Select the file and select Open, and the CSV is displayed in the CSV file dialog.
Once the data is loaded, you'll see it in the Fields pane in Power BI Desktop.
Open Query Editor by selecting Edit Queries from the Home tab in Power BI Desktop.
In the Transform tab, select Run Python Script and the Run Python Script editor appears
Enter your Python Script in the R Script Editor
Note: You'll need to have the pandas library installed in your Python environment for the previous script code to work properly. To install pandas, run the following command in your Python installation: | > pip install pandas
import pandas as pd
completedData = dataset.fillna(method='backfill', inplace=False)
dataset["completedValues"] = completedData["SMI missing values"]
After selecting OK, Query Editor displays a warning about data privacy.
For the Python scripts to work properly in the Power BI service, all data sources need to be set to public.
Now you can finally create your own visualizations depending upon your dataset.
Hope This Helps!!