Spaces:
Build error
Build error
File size: 845 Bytes
c5e4524 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# 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}"""
|