import pandas as pd import gradio as gr import matplotlib.pyplot as plt import seaborn as sns from seaborn import FacetGrid import plotly.express as px def plot_top_best_behaviour_markets(markets_data: pd.DataFrame): """Function to paint the top markets with the lowest metric of distribution gap""" sorted_data = markets_data.sort_values(by="dist_gap_perc", ascending=False) top_best_markets = sorted_data[["title", "sample_datetime", "dist_gap_perc"]].head( 5 ) return gr.DataFrame(top_best_markets)