I am trying to get stock price from Tiingo and append dataframes
data = pd.DataFrame()
lis=[
"AAPL",
"MSFT",
"AMZN",
"GOOGL",
"TSLA",
"GOOG",
"NVDA",
"FB",
"JPM",
"BAC",
"ADBE",
"MA",
"PFE",
"DIS",
"NFLX",
"INTC",
"VZ",
"MO"
]
for i in lis:
data =data.append(client.get_dataframe([i],
frequency='weekly',
metric_name='close',
startDate='2020-03-01',
endDate='2021-12-10'))
however, the result shows a bit different:
AAPL MFST
2020-03-01 100 NAN
2020-03-02 101 NAN
2020-03-03 103 NAN
... NAN
2021-12-10 120 NAN
2020-03-01 NAN 600
2020-03-02 NAN 400
2020-03-03 NAN 300
... NAN
2021-12-10 NAN 1100
how can I make it look like this:
AAPL MFST
2020-03-01 100 600
2020-03-02 101 400
2020-03-03 103 300
...
2021-12-10 120 1100