I can try and produce a reproducible example if need be, but thought I would show the code first. I am using Streamlit and a function which takes a JSON file and produces a table from it in markdown:
table = f"""
|Rank|Title|Value|{"# words|" * n_words}{"Similarity|" * distance}
|--|--|--|--|--|
"""
for i, el in enumerate(data):
line = f"""|{i + 1}|**{el["title"]}**|£{el["value"]:,}|"""
if n_words:
line += f"""{str(el["n_words"])}|"""
if distance:
line += f"""{str(round(el["distance"], 2))}"""
line = f"""{line}
"""
table += line
st.markdown(table)
For some reason, it is working for the first row, but not for any other rows. Am I doing anything which is obviously wrong?
Many thanks!