mortada/fredapi

fredapi cannot load in the gdp output gap data.

chungs123 opened this issue · 4 comments

the dataset I cannot load is called:

100*(Real Gross Domestic Product-Real Potential Gross Domestic Product)/Real Potential Gross Domestic Product

fredapi gets the data from Fred, it doesn't do calculations, for that use pandas.

The actual series are called GDPC1 and GDPPOT, as you can see on the webpage where you found that data.

So your calculation is

100 * (fred.get_series('GDPC1') - fred.get_series('GDPPOT')) / fred.get_series('GDPPOT')

fredapi gets the data from Fred, it doesn't do calculations, for that use pandas.

The actual series are called GDPC1 and GDPPOT, as you can see on the webpage where you found that data.

So your calculation is

100 * (fred.get_series('GDPC1') - fred.get_series('GDPPOT')) / fred.get_series('GDPPOT')

I've tried printing that code, but it says "NaN" as an output because the GDPPOT dataset is giving me data that doesn't correspond with the data in GDPC1. Is there any way to sync the date from GDPPOT to GDPC1?

or to perhaps load from: https://fred.stlouisfed.org/graph/?g=f1cZ

thank you! (im new to python please bear with me. this is my 3rd day coding)

This site (Github) is for bug reports (reporting that the software functionality is incorrect or not as expected). The questions you have would be better answered by referring to the pandas documentation and perhaps Stack Overflow as they are not related to problems with fredapi.

I tried again and I'm getting a value of -16% for potential gdp, but the problem is that potential gdp goes out an extra 10 years, and fredapi uses the latest date. I've been trying to make a workaround using datetime, but I can't figure out a way to make it work. Is there anything I can do for this particular dataset?