Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fredapi cannot load in the gdp output gap data. #43

Open
chungs123 opened this issue Oct 19, 2021 · 4 comments
Open

fredapi cannot load in the gdp output gap data. #43

chungs123 opened this issue Oct 19, 2021 · 4 comments

Comments

@chungs123
Copy link

the dataset I cannot load is called:

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

@Liam3851
Copy link

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

@chungs123
Copy link
Author

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)

@Liam3851
Copy link

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.

@chungs123
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants