Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Creating Python Visuals

Hi,

 

Hoping someone can help me.

 

I'm trying to create a custom Python visual (ridge plot) using the following fields :

(The Compliance (data type: Text) and Assignment Number (data type: Text)  fields are from 2 different tables)

# The following code to create a dataframe and remove duplicated rows is always executed and acts as a preamble for your script:

dataset = pandas.DataFrame(Compliance, Assignment Number)
dataset = dataset.drop_duplicates()
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd

# Paste or type your script code here:
ridge_plot = sns.FacetGrid(dataset, row="Compliance", hue="Compliance", aspect=5, height=1.25)
# Use map function to make density plot in each element of the grid.
ridge_plot.map(sns.kdeplot, "Assignment Number", clip_on=False, shade=True, alpha=0.7, lw=4, bw_method=.2)
ridge_plot.map(plt.axhline, y=0, lw=4, clip_on=False)
ridge_plot.savefig("Ridge_plot.png")
 
When I try to create the visual, I get the below error:
 
chikaae_1-1651746047238.png

I have two questions:

 

Can I create a dataset, for my Python custom visual, from 2 tables that have a one-many relationship ?

 

Also do you know why I'm getting the above error ?

 

Many thanks

 

Also do you know why I'm getting the above error ?

1 REPLY 1
Anonymous
Not applicable

Hi, can you create your visual in a jupyter notebook, or visual code? 

do you have a drawing of the plot you want to make? I don't get it 

 

i have a ridgeplot but in R, that i use in PowerBi , although data is from same dataframe

 

It takes dates and a value, and month for y.axis . Color is a scale gradiente with value as input

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors