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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
chikaae
Frequent Visitor

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
plaralema
Advocate III
Advocate III

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors