%load_problem combined-daily-time-seriesWrite a function combined_daily_time_series that combines stock data from www.alphavantage.co. for given list of symbols and returns a dataframe.
The dataframe should have these numeric columns, open, high, low, close, volume, symbol. Here are some hints. Have a look at these functions and methods
pd.concat, DataFrame.rename, pd.to_numeric
Also write a function get_total_volume which takes dataframe generated by above function and returns a series that symbols as row labels and total volume
for that symbol as a value.
>>> df = combined_daily_time_series(["AAPL","IBM"])
>>> df
open high low close volume symbol
2022-08-25 20:00:00 170.290 170.3500 170.2000 170.2000 11160 AAPL
2022-08-25 20:15:00 170.290 170.3500 170.2000 170.2000 11160 AAPL
2022-08-25 20:30:00 170.290 170.3500 170.2000 170.2000 11160 AAPL
.
.
2022-08-25 20:00:00 170.290 170.3500 170.2000 170.2000 11160 IBM
2022-08-25 20:15:00 170.290 170.3500 170.2000 170.2000 11160 IBM
200 rows × 6 columns
>>> get_total_volume(df)
symbol
AAPL 77772389
IBM 7689538
Name: volume, dtype: int64
You can verify your solution using:
%verify_problem combined-daily-time-series