mortada/fredapi

Get multiple series

katsuya-horiuchi opened this issue · 3 comments

If you want to get multiple series in dataframe, you have to do something like this:

df = pd.DataFrame()
for series in ['VIXCLS', 'SP500']:
    s = fred.get_series(series)
    s.name = series
    df = df.join(s, how='outer')

I wonder if we can add a method to allow you to get multiple series at once.
Noticed there's a PR (#15), but seemed like it contains more than one changes.

Any updates?

This is really clean and easy with a dictionary comprehension:

df = pd.DataFrame({series:fred.get_series(series) for series in ['VIXCLS', 'SP500']})

Is there a way to list all names of all series in the fred database?