How to use Python inside PowerBI

Published: 26 October 2024
on channel: Datascience with Manu
122
4

Python has some interesting functionalities and libraries then can be leveraged inside PowerBI. This video explains how to do that using simple examples and dataset.

1. Code for bar chart:
import pandas
import matplotlib.pyplot as plt
plt.bar(dataset.Region,dataset.Sales)
plt.show()

2. Code for pairplot:
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

Set theme for the plot
sns.set_theme(style="whitegrid")
sns.set()
Use pairplot with colors based on "Region"
sns.pairplot(
dataset[["Region", "Profit", "Quantity"]],
hue="Region", # Color by 'Region'
palette="Set1" # Choose a color palette (e.g., Set2, Set1, etc.)
)
plt.show()


Watch video How to use Python inside PowerBI online without registration, duration hours minute second in high quality. This video was added by user Datascience with Manu 26 October 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 122 once and liked it 4 people.