fredapi icon indicating copy to clipboard operation
fredapi copied to clipboard

fredapi cannot load in the gdp output gap data.

Open chungs123 opened this issue 4 years ago • 4 comments

the dataset I cannot load is called:

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

chungs123 avatar Oct 19 '21 14:10 chungs123

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')

Liam3851 avatar Oct 19 '21 14:10 Liam3851

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)

chungs123 avatar Oct 19 '21 15:10 chungs123

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.

Liam3851 avatar Oct 19 '21 19:10 Liam3851

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?

chungs123 avatar Mar 24 '22 02:03 chungs123