Spaces:
Build error
Build error
# Transcript Retrieval | |
def retrieve_transcript(data, year, quarter, ticker): | |
if year == "All" or quarter == "All": | |
row = ( | |
data.loc[ | |
(data.Ticker == ticker), | |
["File_Name"], | |
] | |
.drop_duplicates() | |
.iloc[0, 0] | |
) | |
else: | |
row = ( | |
data.loc[ | |
(data.Year == int(year)) | |
& (data.Quarter == quarter) | |
& (data.Ticker == ticker), | |
["File_Name"], | |
] | |
.drop_duplicates() | |
.iloc[0, 0] | |
) | |
# convert row to a string and join values with "-" | |
# row_str = "-".join(row.astype(str)) + ".txt" | |
open_file = open( | |
f"Transcripts/{ticker}/{row}", | |
"r", | |
) | |
file_text = open_file.read() | |
return f"""{file_text}""" | |