How to format f-strings from dataframe with curly brackets in the dataframe?
Text in a dataframe that has curly brackets {
and }
in the text, which is intended to trigger f-string formatting of defined variables in the Python code. But the code instead just yields the actual text like "{From}" instead of the actual name. Below is the code. Thank you for your help.
DocText = DT.loc[(DT['To'] == NameList2) & (DT['From'] == NameList1) & (DT['Type'] == 'Document'), 'Text'].reset_index(drop=True)
for i in DocText:
docap(style='ListNumber1').add_run(f'{i}')