Spaces:
Running
Running
poemsforaphrodite
commited on
Commit
•
7a8955f
1
Parent(s):
b600161
Update app.py
Browse files
app.py
CHANGED
@@ -607,8 +607,17 @@ def show_tabular_data(df, co, country_code):
|
|
607 |
total_results = len(results_df)
|
608 |
our_score = results_df.loc[results_df['URL'].str.contains('Our URL'), 'Score'].values[0]
|
609 |
|
610 |
-
#
|
611 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
612 |
|
613 |
st.write(f"Our page ranks {our_rank} out of {total_results} in terms of relevancy score.")
|
614 |
st.write(f"Our relevancy score: {our_score:.4f}")
|
|
|
607 |
total_results = len(results_df)
|
608 |
our_score = results_df.loc[results_df['URL'].str.contains('Our URL'), 'Score'].values[0]
|
609 |
|
610 |
+
# Create a custom style function to highlight only our URL's row
|
611 |
+
def highlight_our_url(row):
|
612 |
+
if 'Our URL' in row['URL']:
|
613 |
+
return ['background-color: lightgreen'] * len(row)
|
614 |
+
return [''] * len(row)
|
615 |
+
|
616 |
+
# Apply the custom style and hide the index
|
617 |
+
styled_df = results_df.style.apply(highlight_our_url, axis=1).hide(axis="index")
|
618 |
+
|
619 |
+
# Display the styled DataFrame
|
620 |
+
st.markdown(styled_df.to_html(), unsafe_allow_html=True)
|
621 |
|
622 |
st.write(f"Our page ranks {our_rank} out of {total_results} in terms of relevancy score.")
|
623 |
st.write(f"Our relevancy score: {our_score:.4f}")
|