Home > Blockchain >  Export Lastest Quarter yfinance Balance Sheet Results Into Single Excel Workbook?
Export Lastest Quarter yfinance Balance Sheet Results Into Single Excel Workbook?

Time:09-23

The code below is what I have so far, thanks to Luis from my enter image description here

CodePudding user response:

This works for me:

results = []

for i in companies:
        result = company_metrics[i].iloc[:, 0]
        results.append(result)

Then build the dataframe:

df = pd.DataFrame(results).T
df.columns = companies

Lastly, build the excel:

df.to_excel('Output.xlsx')

enter image description here

  • Related