Spaces:
Sleeping
Sleeping
Update app.py
Browse files648 unmodified lines64965065165265365420 unmodified lines6756766776786796806816826836846856866876886896906916926936943 unmodified lines698699700701702703704705706707708709710248 unmodified lines959960961962963964965966967968969970971972973648 unmodified lines"Stability","Development","Relationship","Competence",]20 unmodified linesdf_builder_pivot = pd.DataFrame(builder_consolidated)# Define the order of the Trust Driver® categories#trust_driver_order = [# "Stability",# "Development",# "Relationship",# "Benefit",# "Vision",# "Competence",#]trust_driver_order = ["Stability","Development","Relationship","Competence",]# Convert Trust Driver® column to a categorical type with the specified orderdf_builder_pivot["Trust Driver®"] = pd.Categorical(3 unmodified lines)# Sort the DataFrame by 'Trust Driver®' and '%' in descending order within each 'Trust Driver®'#df_builder_pivot = df_builder_pivot.sort_values(# by=["Trust Driver®", "%"], ascending=[True, False]#)df_builder_pivot = df_builder_pivot.sort_values(by=["%"], ascending=[False])df_builder_pivot = df_builder_pivot.head(4)248 unmodified lineslogger.debug(f"df_builder_pivot: {df_builder_pivot}")markdown_5 = gr.Markdown("<span style='font-size:20px; font-weight:bold;'>3) Proof Points</span>",visible=True,)markdown_6 = gr.Markdown("These are the reasons to trust and recommend. They can be your brand values, features, attributes, programmes and messages. "+ "<br>In the first table, use the little arrow in each column to toggle the most to least effective proof points to fill each Trust Bucket®. Your focus is only on the Trust Bucket® with the highest driver impact. "+ "<br>In the second table you see the top scoring proof points ordered by Trust Bucket®. "+ "<br>Note: Even if Trust Buckets for Customers and Prospects overlap, the most effective statements are very different. This provides clear guidance for acquisition versus loyalty activities.",visible=True,)648 unmodified lines64965065165265365465565620 unmodified lines6776786796806816826836846856866876886896906916926936946956966973 unmodified lines701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737248 unmodified lines9869879889899909919929939949959969979989991000648 unmodified lines"Stability","Development","Relationship","Benefit","Vision","Competence",]20 unmodified linesdf_builder_pivot = pd.DataFrame(builder_consolidated)# Define the order of the Trust Driver® categoriestrust_driver_order = ["Stability","Development","Relationship","Benefit","Vision","Competence",]#trust_driver_order = [# "Stability",# "Development",# "Relationship",# "Competence",#]# Convert Trust Driver® column to a categorical type with the specified orderdf_builder_pivot["Trust Driver®"] = pd.Categorical(3 unmodified lines)# Sort the DataFrame by 'Trust Driver®' and '%' in descending order within each 'Trust Driver®'df_builder_pivot = df_builder_pivot.sort_values(by=["Trust Driver®", "%"], ascending=[True, False])def text_color_trust_driver(trust_driver):colors = {"Stability": "color: #42546C","Development": "color: #D4B372","Relationship": "color: #A94E4D","Benefit": "color: #5C8084","Vision": "color: #C98F69","Competence": "color: #7B92A7",}return colors.get(trust_driver, "")# Apply the text color function to the DataFramestyled_df = df_builder_pivot.style.applymap(lambda trust_driver: text_color_trust_driver(trust_driver), subset=["Trust Driver®"])# Convert the styled DataFrame to HTML for Gradio displaystyled_html = styled_df.render()# Use Gradio's `gr.HTML` to render the table with colored textgr.Interface(fn=lambda: styled_html,inputs=[],outputs="html").launch()#df_builder_pivot = df_builder_pivot.sort_values(# by=["%"], ascending=[False]#)#df_builder_pivot = df_builder_pivot.head(4)248 unmodified lineslogger.debug(f"df_builder_pivot: {df_builder_pivot}")markdown_5 = gr.Markdown("<span style='font-size:20px; font-weight:bold;'>3)TrustBuilders® </span>",visible=True,)markdown_6 = gr.Markdown("These are the reasons to trust and recommend. They can be your brand values, features, attributes, programmes and messages. "+ "<br>In the table, use the little arrow in each column to toggle the most to least effective TrustBuilders® to fill each Trust Bucket®. Your focus is only on the Trust Bucket® with the highest driver impact. "#+ "<br>In the second table you see the top scoring TrustBuilders® ordered by Trust Bucket®. "+ "<br>Retain Note: Even if Trust Buckets for Customers and Prospects overlap, the most effective statements are very different. This provides clear guidance for acquisition versus loyalty activities.",visible=True,)
app.py+44-17