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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors