Skip to content

BUG: fixing ewma() for adjust=False and ignore_na=False #7896

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

Merged
merged 1 commit into from
Aug 1, 2014

Conversation

seth-p
Copy link
Contributor

@seth-p seth-p commented Aug 1, 2014

The previous code in #7603 wasn't quite right for the case that both adjust=False and ignore_na=False. This PR fixes the handling of that case. Note that ignore_na=False behavior is new in v0.15.0, so this bug and its fix don't affect any prior behavior.

@jreback jreback added this to the 0.15.0 milestone Aug 1, 2014
@jreback
Copy link
Contributor

jreback commented Aug 1, 2014

side issue can you add a couple of examples in the doc-string of ewma? Including one with adust
thxs

@seth-p
Copy link
Contributor Author

seth-p commented Aug 1, 2014

Happy to give it a shot, though to be honest I'm not quite sure what to put there. Can you point me to some other doc strings that have such examples? I can add more verbose notes about adjust (which to my mind isn't documented very clearly) and ignore_na to _ewm_notes (which is used to construct the doc strings for all the ewm*() functions), though I don't see numerical examples being illuminating.

@jreback
Copy link
Contributor

jreback commented Aug 1, 2014

http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.xs.html?highlight=xs#pandas.DataFrame.xs

(just showing some examples, these are for users to copy-paste). if it doesn't add then its ok. but a bit more docs are always better.

@seth-p
Copy link
Contributor Author

seth-p commented Aug 1, 2014

I don't think examples will add much, as it's just setting adjust=True or False and producing different numbers, but they won't be intuitive either way. I will augment _ewm_notes to give a better explanation of what adjust and ignore_na do, and will update this PR.

@seth-p
Copy link
Contributor Author

seth-p commented Aug 1, 2014

I've updated _ewm_notes to give a much clearer description of adjust and ignore_na. Let me know what you think.

@seth-p
Copy link
Contributor Author

seth-p commented Aug 1, 2014

Actually, let me make a slight edit...

@jreback
Copy link
Contributor

jreback commented Aug 1, 2014

that looks good. does this need to also be on the other ewma_* doc-strings?

(you can simply put this in a variable and use Appender to propgate this)

@seth-p
Copy link
Contributor Author

seth-p commented Aug 1, 2014

I put it in _ewm_notes, which I think is incorporated into all the ewm* doc strings automatically. I'm making a slight edit...

@seth-p
Copy link
Contributor Author

seth-p commented Aug 1, 2014

OK, I'm done editing.
Yep, all the ewm* functions begin with @Substitution(..., _ewm_notes), so these updated notes should be reflected in all the ewm* doc strings.

@seth-p
Copy link
Contributor Author

seth-p commented Aug 1, 2014

The Travis CI build passed.

jreback added a commit that referenced this pull request Aug 1, 2014
BUG: fixing ewma() for adjust=False and ignore_na=False
@jreback jreback merged commit 7705027 into pandas-dev:master Aug 1, 2014
@seth-p seth-p deleted the ewma_missing_weights_fix1 branch September 10, 2014 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants