-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Adding '.' as an na_value for FRED. #3469
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
Conversation
I see you haven't got travis going, is this covered by the test suite? if not, please add a test to thanks. |
Thanks, I'll get a test going added and I'll try to get travis set up also. I've never used it before. One question: I could be missing it, but I'm not sure the fred code is covered by any tests. I greped through the pandas/io/tests/ directory and I didn't see any references to fred. Should I start a new file similar to the ones for yahoo and wb? I can add some more tests while I'm in there too. |
Yeah, that's not a part of the code I'm familiar with, it's possible. In which case |
CONTRIBUTING.MD has a link to the travis instructions, and other stuff if you remember to tag your tests @network(+@slow?) |
related #3413 |
OK I think Travis is testing my branch now. Assuming that passes, do you want me to try to stuff both my changes (handling the NaNs and adding the tests) into a single PR? Or should I do them separately? |
Same PR makes sense, feel free to add as many commits as you like to the PR branch and If your git-fu is good, you can rewrite and force push and all that in PR branches, that's Thanks. |
I added a check for if the name you gave is a valid FRED series name, and a test that goes along with it. I'm worried that it will break if the St. Louis Fed decides to change their response to an invalid name. But the way I coded it, it should only occur if we already failed to return a dataframe. It's basically just a more informative error message. I'd like to take a crack at #3413, but I might not have time until later this week. It should be something as simple as changing the fred branch of the main DataReader function to names = list(name) # if string is passed for a single series
return pd.concat([get_data_fred(name, start, end) for name in names]) I may let someone else handle the history rewriting. Last time I tried that over on statsmodels, I think I gave Joseph a headache. Travis is testing now. I'll add the final bit and mark it as ready to merge when it's done. |
OK This should be ready to go if you think it looks acceptable. Thanks for the help y-p. |
One last thing, could you add a note to RELEASE.rst, to let users know you "fixed it ™"? |
Will do. I've just noticed that I'm on
And then adding the changes to RELEASE.rst and pushing again? Sorry. |
Exactly right. some people have a hard time grokking rebase. but that's the way |
Well I think I messed something up. After fetching and rebaseing my master onto upstream/master, when I did
So I did |
first, don't panic. Most important git command in existence:
Coupled with
|
that error message is actually fine. origin has the previous state based on 0.11.0rc1, write down the commit hash that's "safe" to go back to: a80acc4
|
This a very minimal, but it wasn't previously covered. I've added a new to contain the tests and more or less copied code from the test_yahoo file.
get_data_fred function.
I panicked :) Seems to look ok now I think, once Travis is done? |
ENH: Adding '.' as an na_value for FRED.
Everything passes locally on my box. in it goes... The log shows this is your first PR to pandas. good job! 👍 |
The St. Louis Fed's FRED uses '.' as an NaN marker. I don't think the user has any way to specify the na_value via DataReader, so this just hard codes '.' as an na_value in the fred data-fetching function.
Before:
After
Hopefully I've done everything correctly with the pull request. Let me know if anything needs fixing.